Makefile: call build with whatsupnix
This commit is contained in:
parent
954996f78f
commit
62638ad7f1
18
Makefile
18
Makefile
@ -51,13 +51,23 @@ $(if $(target_user),,$(error unbound variable: target_user))
|
|||||||
$(if $(target_port),,$(error unbound variable: target_port))
|
$(if $(target_port),,$(error unbound variable: target_port))
|
||||||
$(if $(target_path),,$(error unbound variable: target_path))
|
$(if $(target_path),,$(error unbound variable: target_path))
|
||||||
|
|
||||||
|
whatsupnix = \
|
||||||
|
if type whatsupnix >/dev/null 2>&1; then \
|
||||||
|
whatsupnix $(1); \
|
||||||
|
else \
|
||||||
|
cat; \
|
||||||
|
fi
|
||||||
|
|
||||||
build = \
|
build = \
|
||||||
nix-build \
|
nix-build \
|
||||||
|
-Q \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
--show-trace \
|
--show-trace \
|
||||||
-I nixos-config=$(nixos-config) \
|
-I nixos-config=$(nixos-config) \
|
||||||
-I stockholm=$(stockholm) \
|
-I stockholm=$(stockholm) \
|
||||||
-E "with import <stockholm>; $(1)"
|
-E "with import <stockholm>; $(1)" \
|
||||||
|
$(2) \
|
||||||
|
|& $(call whatsupnix)
|
||||||
|
|
||||||
evaluate = \
|
evaluate = \
|
||||||
nix-instantiate \
|
nix-instantiate \
|
||||||
@ -84,11 +94,7 @@ deploy:
|
|||||||
$(ssh) $(target_user)@$(target_host) -p $(target_port) \
|
$(ssh) $(target_user)@$(target_host) -p $(target_port) \
|
||||||
env STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \
|
env STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \
|
||||||
nixos-rebuild -Q $(rebuild-command) --show-trace -I $(target_path) \
|
nixos-rebuild -Q $(rebuild-command) --show-trace -I $(target_path) \
|
||||||
|& if type whatsupnix 2>/dev/null; then \
|
|& $(call whatsupnix,$(target_user)@$(target_host):$(target_port))
|
||||||
whatsupnix $(target_user)@$(target_host):$(target_port); \
|
|
||||||
else \
|
|
||||||
cat; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# usage: make populate system=foo
|
# usage: make populate system=foo
|
||||||
populate: populate-target = \
|
populate: populate-target = \
|
||||||
|
Loading…
Reference in New Issue
Block a user