X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=nixops%2FMakefile;h=18d48eb552c4eda3da184c2b991ba3dd8b8f69ad;hp=a7b24cd98c7cd7dfe7d78daf57eadb0f39612a91;hb=da28a4e2afef21710f73860b26893fa18dd32858;hpb=1052bfda27ad0607cd4dc5dc91e2d8e8220c30c7 diff --git a/nixops/Makefile b/nixops/Makefile index a7b24cd..18d48eb 100644 --- a/nixops/Makefile +++ b/nixops/Makefile @@ -1,14 +1,8 @@ -export -PASSWORD_STORE_DIR = $(shell pwd)/secrets -NIXOPS_STATE ?= ./state/eldiron.nixops -NIXOPS_DEPLOYMENT = cef694f3-081d-11e9-b31f-0242ec186adf -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) +ifndef NIXOPS_ENV_LOADED + $(error "Please load environment with direnv") +endif + +NIXOPS_PRIV = ./scripts/with_env nixops ###### Current channel information nix-info: @@ -102,21 +96,21 @@ cleanup: delete-generations ###### Pull environment and deployment from remote pull_deployment: - @if $(NIXOPS) info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null ; then \ + @if nixops info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null ; then \ echo "This will remove your current deployment file and recreate it!. Continue? [y/N]" && \ read y && \ [ "$$y" = "y" -o "$$y" = "Y" ] && \ - $(NIXOPS) delete --force -d $(NIXOPS_DEPLOYMENT); \ + nixops delete --force -d $(NIXOPS_DEPLOYMENT); \ fi - pass show Nixops/Deployment | $(NIXOPS) import - $(NIXOPS) modify -d $(NIXOPS_DEPLOYMENT) "$$(pwd)/default.nix" + pass show Nixops/Deployment | nixops import + nixops modify -d $(NIXOPS_DEPLOYMENT) "$$(pwd)/default.nix" .PHONY: pull_deployment deployment_is_set: - $(NIXOPS) info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null + nixops info -d $(NIXOPS_DEPLOYMENT) 2>/dev/null >/dev/null .PHONY: deployment_is_set ###### Push deployment information to password store push_deployment: - $(NIXOPS) export | pass insert -m Nixops/Deployment + nixops export | pass insert -m Nixops/Deployment .PHONY: push