diff options
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | krebs/v2/default.nix (renamed from krebs/populate.nix) | 6 |
2 files changed, 14 insertions, 5 deletions
@@ -33,15 +33,20 @@ deploy2: export target-host = $(target) else deploy2: export target-host = $(system) endif +deploy2: export source = \ + with (import ~/stockholm {}).users.$(LOGNAME).$(system).config.krebs.build; \ + assert source-version == 2; \ + source deploy2:;@ target=$${target-$$system} result=$$(nix-instantiate \ - --json \ --eval \ - krebs/populate.nix \ - --arg source 'with (import ~/stockholm {}).users.$(LOGNAME).$(system).config.krebs.build; assert source-version == 2; source' \ + --json \ + --arg source "$$source" \ --argstr target-host "$$target" \ - --argstr target-path /var/src) + --argstr target-path /var/src \ + -A populate \ + krebs/v2) script=$$(echo "$$result" | jq -r .) echo "$$script" | sh ssh root@$$target nixos-rebuild switch -I /var/src diff --git a/krebs/populate.nix b/krebs/v2/default.nix index 13270c8a7..7eb60103f 100644 --- a/krebs/populate.nix +++ b/krebs/v2/default.nix @@ -9,7 +9,11 @@ with import ~/stockholm/krebs/4lib { }; with builtins; let - out = '' + out = { + inherit populate; + }; + + populate = '' #! /bin/sh set -efu |