summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-02-16 07:31:37 +0100
committertv <tv@krebsco.de>2016-02-16 07:32:54 +0100
commit439f913348f6135e0fd99d4e580a67a602bd72df (patch)
treef17b1ed5c9960ab93a310a6214dbf6b55aa34265 /Makefile
parent4fb829af7e5e9cb2837a052f34d789faf9f3cda9 (diff)
Makefile: make nixos-config configurable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a73a1aaf..e1889fc1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
-ifndef system
-$(error unbound variable: system)
+stockholm ?= .
+
+ifndef nixos-config
+$(if $(system),,$(error unbound variable: system))
+nixos-config = ./$(LOGNAME)/1systems/$(system).nix
endif
# target = [target_user@]target_host[:target_port][/target_path]
@@ -31,13 +34,18 @@ export target_user ?= root
export target_port ?= 22
export target_path ?= /var/src
+$(if $(target_host),,$(error unbound variable: target_host))
+$(if $(target_user),,$(error unbound variable: target_user))
+$(if $(target_port),,$(error unbound variable: target_port))
+$(if $(target_path),,$(error unbound variable: target_path))
+
evaluate = \
nix-instantiate \
--eval \
--readonly-mode \
--show-trace \
- -I nixos-config=./$(LOGNAME)/1systems/$(system).nix \
- -I stockholm=. \
+ -I nixos-config=$(nixos-config) \
+ -I stockholm=$(stockholm) \
$(1)
execute = \