make eval
This commit is contained in:
parent
8e41a4be47
commit
cd0a4d3bad
15
Makefile
15
Makefile
|
@ -2,6 +2,7 @@
|
||||||
# usage:
|
# usage:
|
||||||
# make system=foo
|
# make system=foo
|
||||||
# make systems='foo bar'
|
# make systems='foo bar'
|
||||||
|
# make eval system=foo get=config.networking.extraHosts
|
||||||
#
|
#
|
||||||
|
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
|
@ -82,6 +83,20 @@ deploy:;@
|
||||||
|
|
||||||
result/bin/switch-to-configuration switch
|
result/bin/switch-to-configuration switch
|
||||||
EOF
|
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
|
else
|
||||||
$(error unbound variable: system[s])
|
$(error unbound variable: system[s])
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user