diff options
author | tv <tv@krebsco.de> | 2016-02-01 03:00:48 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-01 03:32:30 +0100 |
commit | c3c4aac670cf0ac26340061cef1527b3d7f64386 (patch) | |
tree | 6d504709b7f1fa2274d2867b4cdbad4966f0c622 /Makefile | |
parent | 1a4437cb26a29400d33486d6c8a220a9e88f4132 (diff) |
make deploy2: deploy using nixos-rebuild switch
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -26,6 +26,25 @@ deploy infest:;@ export filter=json make -s eval | 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: @ |