summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-07-23 02:26:42 +0200
committerlassulus <lass@aidsballs.de>2015-07-23 02:26:42 +0200
commit0db3f4ee695148b60238861384b86f0fdc880459 (patch)
tree8249b4e2713aeabdf4a9d1aeee4c38e1a527e487 /Makefile
parentb590d9e21d8c99a91fd419c3e0bea949a9ac6849 (diff)
parent791a7e79977de76908ab9e33eb64cbd2b02da3ed (diff)
Merge branch 'tv' into master
Diffstat (limited to 'Makefile')
-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