From d954dd5e192834a72a2d05b428fc0e8cef599c31 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 12 Feb 2016 19:48:16 +0100 Subject: Makefile: interpolate $(target_*) for a nicer log --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e61d16b75..9ed045e4d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ export target_path ?= /var/src evaluate = \ nix-instantiate \ - --arg configuration "./$$LOGNAME/1systems/$$system.nix" \ + --arg configuration ./$(LOGNAME)/1systems/$(system).nix \ --eval \ --readonly-mode \ --show-trace \ @@ -22,7 +22,7 @@ execute = \ # usage: make deploy system=foo [target_host=bar] deploy: $(call execute,populate) - @set -x; ssh "$$target_user@$$target_host" nixos-rebuild switch -I "$$target_path" + ssh $(target_user)@$(target_host) nixos-rebuild switch -I $(target_path) # usage: make LOGNAME=shared system=wolf eval.config.krebs.build.host.name eval eval.:;@$(call evaluate) -- cgit v1.2.3 From 1497ee718256ff48c65ebcb0ddea633c6628eb69 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 12 Feb 2016 19:56:04 +0100 Subject: Makefile: enable "make install" --- Makefile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9ed045e4d..f39ed0c02 100644 --- a/Makefile +++ b/Makefile @@ -28,14 +28,13 @@ deploy: eval eval.:;@$(call evaluate) eval.%:;@$(call evaluate,-A $*) -## usage: make install system=foo target= -#.PHONY: install -#install: ssh = ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -#install:;@set -x -# $(ssh) "$$target_user@$$target_host" \ -# env target_path="$target_path" \ -# sh -s prepare < krebs/4lib/infest/prepare.sh -# make -s populate target_path=/mnt"$$target_path" -# $(ssh) "$$target_user@$$target_host" \ -# env NIXOS_CONFIG=/var/src/nixos-config \ -# nixos-install +# usage: make install system=foo [target_host=bar] +install: ssh = ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null +install: + $(ssh) $(target_user)@$(target_host) \ + env target_path=$(target_path) \ + sh -s prepare < krebs/4lib/infest/prepare.sh + target_path=/mnt$(target_path) $(call execute,populate) + $(ssh) $(target_user)@$(target_host) \ + env NIXOS_CONFIG=$(target_path)/nixos-config \ + nixos-install -- cgit v1.2.3