X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2FMakefile;h=d8268ccb423b5bc5b87f15e7c373f8b7baeb5c0b;hb=ccda44f3d06002684668f98c3ea9ba43d967ab65;hp=6adc6e76766aa2b941738cd53b0b663588f4c474;hpb=f33aade75160a345a721fd60451b9edaa4d10e44;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/Makefile b/nixops/Makefile index 6adc6e7..d8268cc 100644 --- a/nixops/Makefile +++ b/nixops/Makefile @@ -5,8 +5,10 @@ endif NIXOPS_STATE ?= ./state/eldiron.nixops NIXOPS_DEPLOYMENT = cef694f3-081d-11e9-b31f-0242ec186adf -nixpkgs ?= https://releases.nixos.org/nixos/19.03/nixos-19.03.172754.0728c3e026e/nixexprs.tar.xz -NIX_PATH = nixpkgs=${nixpkgs}:nixpkgsNext=${nixpkgs}:nixpkgsPrevious=${nixpkgs} +nixpkgs ?= $(shell cat ../nix/sources.json | jq -r '."nixpkgs-nixops".url') +nixpkgsNext ?= $(shell cat ../nix/sources.json | jq -r '."nixpkgs-nixops-next".url') +nixpkgsPrevious ?= $(shell cat ../nix/sources.json | jq -r '."nixpkgs-nixops-previous".url') +NIX_PATH = nixpkgs=${nixpkgs}:nixpkgsNext=${nixpkgsNext}:nixpkgsPrevious=${nixpkgsPrevious} NIXOPS := $(shell NIX_PATH=$(NIX_PATH) nix-build --no-out-link -E "with import { overlays = builtins.attrValues (import ../overlays); }; nixops")/bin/nixops NIXOPS_PRIV = ./scripts/with_env $(NIXOPS) @@ -16,7 +18,7 @@ nix-info: @version=$$(nix eval --raw nixpkgs.lib.version) && \ mainversion=$$(echo $$version | cut -d"." -f -2) && \ echo "https://releases.nixos.org/nixos/$$mainversion/nixos-$$version/nixexprs.tar.xz" && \ - nix eval --raw nixpkgs.bc.meta.position | cut -d"/" -f-4 + nix-instantiate --find-file nixpkgs .PHONY: nix-info ###### Initial setup @@ -33,6 +35,15 @@ SSH_ARGS ?= ssh-eldiron: $(NIXOPS_PRIV) ssh eldiron -- $(SSH_ARGS) +ssh-dilion: + $(NIXOPS_PRIV) ssh dilion -- $(SSH_ARGS) + +ssh-backup-2: + $(NIXOPS_PRIV) ssh backup-2 -- $(SSH_ARGS) + +ssh-monitoring-1: + $(NIXOPS_PRIV) ssh monitoring-1 -- $(SSH_ARGS) + info: $(NIXOPS_PRIV) list $(NIXOPS_PRIV) info @@ -71,11 +82,17 @@ list-generations: delete-generations: nix-env -p $(profile) --delete-generations $(GEN) $(NIXOPS_PRIV) ssh eldiron -- nix-env -p /nix/var/nix/profiles/system --delete-generations $(GEN) + $(NIXOPS_PRIV) ssh dilion -- nix-env -p /nix/var/nix/profiles/system --delete-generations $(GEN) + $(NIXOPS_PRIV) ssh backup-2 -- nix-env -p /nix/var/nix/profiles/system --delete-generations $(GEN) + $(NIXOPS_PRIV) ssh monitoring-1 -- nix-env -p /nix/var/nix/profiles/system --delete-generations $(GEN) .PHONY: delete-generations cleanup: delete-generations nix-store --gc $(NIXOPS_PRIV) ssh eldiron -- nix-store --gc + $(NIXOPS_PRIV) ssh dilion -- nix-store --gc + $(NIXOPS_PRIV) ssh backup-2 -- nix-store --gc + $(NIXOPS_PRIV) ssh monitoring-1 -- nix-store --gc .PHONY: cleanup ###### Pull environment and deployment from remote