summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-05-21 13:57:45 +0200
committerlassulus <lass@aidsballs.de>2016-05-21 13:57:45 +0200
commitfacb65bd22226742b1805138b2841b29c4c26012 (patch)
treec715a398c6941403b9e23532c84be3f36e3cc653 /Makefile
parent86c16adf7cefac38dcaaf29ea6705e37fe126fe9 (diff)
parent97c2e4bbd99f6034d550a83804e508c278045b67 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7252ca70e..a74e3a877 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ export STOCKHOLM_VERSION ?= $(shell \
printf '%s' "$$date.$$version"; \
)
+system ?= $(HOSTNAME)
$(if $(system),,$(error unbound variable: system))
nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system).nix
@@ -54,15 +55,17 @@ evaluate = \
--show-trace \
-I nixos-config=$(nixos-config) \
-I stockholm=$(stockholm) \
- -E '{ eval, f }: f eval' \
- --arg eval 'import ./.' \
- --arg f "eval@{ config, ... }: $(1)"
+ -E "let eval = import <stockholm>; in with eval; $(1)"
execute = \
result=$$($(call evaluate,config.krebs.build.$(1))) && \
script=$$(echo "$$result" | jq -r .) && \
echo "$$script" | PS5=% sh
+ifeq ($(MAKECMDGOALS),)
+$(error No goals specified)
+endif
+
# usage: make deploy system=foo [target_host=bar]
deploy: ssh ?= ssh
deploy:
@@ -73,7 +76,7 @@ deploy:
# usage: make LOGNAME=shared system=wolf eval.config.krebs.build.host.name
eval eval.:;@$(call evaluate,$${expr-eval})
-eval.%:;@$(call evaluate,$*)
+eval.%:;@$(call evaluate,$@)
# usage: make install system=foo [target_host=bar]
install: ssh ?= ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null