summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5b898c54c..a35d6d128 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,27 @@ else ifdef system
deploy infest:;@
export get=krebs.$@
export filter=json
- make -s eval | sh
+ script=$$(make -s eval)
+ echo "$$script" | sh
+
+.PHONY: deploy2
+ifdef target
+deploy2: export target-host = $(target)
+else
+deploy2: export target-host = $(system)
+endif
+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' \
+ --argstr target-host "$$target" \
+ --argstr target-path /var/src)
+ script=$$(echo "$$result" | jq -r .)
+ echo "$$script" | sh
+ ssh root@$$target nixos-rebuild switch -I /var/src
.PHONY: eval
eval: