aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/krops/default.nix18
1 files changed, 15 insertions, 3 deletions
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: {