summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-07-23 01:04:51 +0200
committertv <tv@shackspace.de>2015-07-23 01:04:51 +0200
commitcd0a4d3bad0c7975df8dea5fd66614dda9fcfa32 (patch)
tree02febe821675da5c276b7611b1dabb23912cff9f
parent8e41a4be471cd9bb74c8667140a70f8c05c363d4 (diff)
make eval
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7225a5d6b..da234677b 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@
# usage:
# make system=foo
# make systems='foo bar'
+# make eval system=foo get=config.networking.extraHosts
#
.ONESHELL:
@@ -82,6 +83,20 @@ deploy:;@
result/bin/switch-to-configuration switch
EOF
+
+.PHONY: eval
+eval:
+ @nix-instantiate \
+ --json \
+ --eval \
+ --strict \
+ -A "$$get" \
+ -E '
+ import <nixpkgs/nixos/lib/eval-config.nix> {
+ system = builtins.currentSystem;
+ modules = [ ./1systems/$(LOGNAME)/$(system).nix ];
+ }
+ ' | jq -r .
else
$(error unbound variable: system[s])
endif