krebs/populate.nix -> krebs/v2 populate

This commit is contained in:
tv 2016-02-02 01:53:38 +01:00
parent 07fa0d9896
commit 2497533b90
2 changed files with 14 additions and 5 deletions

View File

@ -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

View File

@ -9,7 +9,11 @@ with import ~/stockholm/krebs/4lib {
};
with builtins;
let
out = ''
out = {
inherit populate;
};
populate = ''
#! /bin/sh
set -efu