aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-06-08 22:38:26 +0200
committertv <tv@krebsco.de>2020-06-08 22:59:37 +0200
commit67132ed53f41c78377306c782e06590cbde91982 (patch)
treebc1e1a4d7226908e28218d875719ca5004606387
parent476fb97dc91032dcef7e812a7473ea7df90ae537 (diff)
krops remoteCommand: don't ssh if target is local
-rw-r--r--pkgs/krops/default.nix21
1 files changed, 12 insertions, 9 deletions
diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix
index 4760287..ab2a722 100644
--- a/pkgs/krops/default.nix
+++ b/pkgs/krops/default.nix
@@ -18,15 +18,18 @@ in
}";
remoteCommand = target: command:
- writers.writeDash "build.${target.host}" ''
- exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
- (lib.optionals (target.user != "") ["-l" target.user])
- "-p" target.port
- "-t"
- target.extraOptions
- target.host
- (if target.sudo then "sudo ${command}" else command)])}
- '';
+ if lib.isLocalTarget target
+ then command
+ else
+ writers.writeDash "build.${target.host}" ''
+ exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [
+ (lib.optionals (target.user != "") ["-l" target.user])
+ "-p" target.port
+ "-t"
+ target.extraOptions
+ target.host
+ (if target.sudo then "sudo ${command}" else command)])}
+ '';
writeCommand = name: {
command ? (targetPath: "echo ${targetPath}"),