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') 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