summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-02-16 12:49:04 +0100
committertv <tv@krebsco.de>2016-02-16 13:29:10 +0100
commit612ac0110dfe95366cb17ab13a88c6c8547245ed (patch)
treeab67d282fb3a48d1709ee9b8f92cb7bb4dcfcaeb /Makefile
parentf7a3c26e5c294bbf3ce4505c5b273153cfe48afc (diff)
make test [method={build,eval}] # default=eval
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8d1498d..60dfe80 100644
--- a/Makefile
+++ b/Makefile
@@ -75,10 +75,20 @@ install:
env NIXOS_CONFIG=$(target_path)/nixos-config \
nixos-install
-# usage: make test system=foo [target=bar]
+# usage: make test system=foo [target=bar] [method={eval,build}]
+method ?= eval
+ifeq ($(method),build)
+test: command = nix-build --no-out-link
+else
+ifeq ($(method),eval)
+test: command ?= nix-instantiate --eval --json --readonly-mode --strict
+else
+$(error bad method: $(method))
+endif
+endif
test: ssh ?= ssh
test:
$(call execute,populate)
$(ssh) $(target_user)@$(target_host) -p $(target_port) \
- nix-build --no-out-link --show-trace -I $(target_path) \
+ $(command) --show-trace -I $(target_path) \
-A config.system.build.toplevel $(target_path)/stockholm