From cd0a4d3bad0c7975df8dea5fd66614dda9fcfa32 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 23 Jul 2015 01:04:51 +0200 Subject: make eval --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7225a5d6..da234677 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 { + system = builtins.currentSystem; + modules = [ ./1systems/$(LOGNAME)/$(system).nix ]; + } + ' | jq -r . else $(error unbound variable: system[s]) endif -- cgit v1.2.3