]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/Makefile
Bootstrap niv
[perso/Immae/Config/Nix.git] / nixops / Makefile
index 02d34f80094c7a4efdb1be52eaec50b596b99193..d8268ccb423b5bc5b87f15e7c373f8b7baeb5c0b 100644 (file)
@@ -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.173677.daf861a810d/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 <nixpkgs> { overlays = builtins.attrValues (import ../overlays); }; nixops")/bin/nixops
 NIXOPS_PRIV = ./scripts/with_env $(NIXOPS)
@@ -33,6 +35,9 @@ 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)
 
@@ -77,6 +82,7 @@ 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
@@ -84,6 +90,7 @@ 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