diff options
Diffstat (limited to 'nixops/Makefile')
-rw-r--r-- | nixops/Makefile | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/nixops/Makefile b/nixops/Makefile index a7b24cd..18d48eb 100644 --- a/nixops/Makefile +++ b/nixops/Makefile | |||
@@ -1,14 +1,8 @@ | |||
1 | export | 1 | ifndef NIXOPS_ENV_LOADED |
2 | PASSWORD_STORE_DIR = $(shell pwd)/secrets | 2 | $(error "Please load environment with direnv") |
3 | NIXOPS_STATE ?= ./state/eldiron.nixops | 3 | endif |
4 | NIXOPS_DEPLOYMENT = cef694f3-081d-11e9-b31f-0242ec186adf | 4 | |
5 | nixpkgs ?= $(shell cat ../nix/sources.json | jq -r '."nixpkgs-nixops".url') | 5 | NIXOPS_PRIV = ./scripts/with_env nixops |
6 | nixpkgsNext ?= $(shell cat ../nix/sources.json | jq -r '."nixpkgs-nixops-next".url') | ||
7 | nixpkgsPrevious ?= $(shell cat ../nix/sources.json | jq -r '."nixpkgs-nixops-previous".url') | ||
8 | NIX_PATH = nixpkgs=${nixpkgs}:nixpkgsNext=${nixpkgsNext}:nixpkgsPrevious=${nixpkgsPrevious} | ||
9 | |||
10 | NIXOPS := $(shell NIX_PATH=$(NIX_PATH) nix-build --no-out-link -E "with import <nixpkgs> { overlays = builtins.attrValues (import ../overlays); }; nixops")/bin/nixops | ||
11 | NIXOPS_PRIV = ./scripts/with_env $(NIXOPS) | ||
12 | 6 | ||
13 | ###### Current channel information | 7 | ###### Current channel information |
14 | nix-info: | 8 | nix-info: |
@@ -102,21 +96,21 @@ cleanup: delete-generations | |||
102 | 96 | ||
103 | ###### Pull environment and deployment from remote | 97 | ###### Pull environment and deployment from remote |
104 | pull_deployment: | 98 | pull_deployment: |
105 | @if $(NIXOPS) info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null ; then \ | 99 | @if nixops info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null ; then \ |
106 | echo "This will remove your current deployment file and recreate it!. Continue? [y/N]" && \ | 100 | echo "This will remove your current deployment file and recreate it!. Continue? [y/N]" && \ |
107 | read y && \ | 101 | read y && \ |
108 | [ "$$y" = "y" -o "$$y" = "Y" ] && \ | 102 | [ "$$y" = "y" -o "$$y" = "Y" ] && \ |
109 | $(NIXOPS) delete --force -d $(NIXOPS_DEPLOYMENT); \ | 103 | nixops delete --force -d $(NIXOPS_DEPLOYMENT); \ |
110 | fi | 104 | fi |
111 | pass show Nixops/Deployment | $(NIXOPS) import | 105 | pass show Nixops/Deployment | nixops import |
112 | $(NIXOPS) modify -d $(NIXOPS_DEPLOYMENT) "$$(pwd)/default.nix" | 106 | nixops modify -d $(NIXOPS_DEPLOYMENT) "$$(pwd)/default.nix" |
113 | .PHONY: pull_deployment | 107 | .PHONY: pull_deployment |
114 | 108 | ||
115 | deployment_is_set: | 109 | deployment_is_set: |
116 | $(NIXOPS) info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null | 110 | nixops info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null |
117 | .PHONY: deployment_is_set | 111 | .PHONY: deployment_is_set |
118 | 112 | ||
119 | ###### Push deployment information to password store | 113 | ###### Push deployment information to password store |
120 | push_deployment: | 114 | push_deployment: |
121 | $(NIXOPS) export | pass insert -m Nixops/Deployment | 115 | nixops export | pass insert -m Nixops/Deployment |
122 | .PHONY: push | 116 | .PHONY: push |