From 402c9cac2595f2219efb8bb51becd337bbcb7965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 29 Dec 2019 21:43:58 +0000 Subject: writeDeploy: add support for build hosts This allows to evaluate & build the system on the dedicated build host, from which the build artifacts are uploaded onto the target machine. --- pkgs/krops/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'pkgs/krops/default.nix') diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index a3e7745..700066e 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -47,21 +47,33 @@ in writeDeploy = name: { backup ? false, + buildTarget ? null, fast ? false, force ? false, source, target }: let + buildTarget' = + if buildTarget == null + then target' + else lib.mkTarget buildTarget; target' = lib.mkTarget target; in writeDash name '' set -efu + ${lib.optionalString (buildTarget' != target') + (populate { inherit backup force source; target = buildTarget'; })} ${populate { inherit backup force source; target = target'; }} ${lib.optionalString (! fast) '' - ${rebuild ["dry-build"] target'} - ${build target'} + ${rebuild ["dry-build"] buildTarget'} + ${build buildTarget'} ''} - ${rebuild ["switch"] target'} + ${rebuild ([ + "switch" + ] ++ lib.optionals (buildTarget' != target') [ + "--build-host" "${buildTarget'.user}@${buildTarget'.host}" + "--target-host" "${target'.user}@${target'.host}" + ]) buildTarget'} ''; writeTest = name: { -- cgit v1.2.3 From ea7e0c3a35e94eec5242d9344db9bc4d54056497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 29 Dec 2019 21:44:21 +0000 Subject: writeDeploy: add crossDeploy argument --- pkgs/krops/default.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkgs/krops/default.nix') diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index 700066e..16ef936 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -48,6 +48,7 @@ in writeDeploy = name: { backup ? false, buildTarget ? null, + crossDeploy ? false, fast ? false, force ? false, source, @@ -70,6 +71,8 @@ in ''} ${rebuild ([ "switch" + ] ++ lib.optionals crossDeploy [ + "--no-build-nix" ] ++ lib.optionals (buildTarget' != target') [ "--build-host" "${buildTarget'.user}@${buildTarget'.host}" "--target-host" "${target'.user}@${target'.host}" -- cgit v1.2.3