From 67132ed53f41c78377306c782e06590cbde91982 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 8 Jun 2020 22:38:26 +0200 Subject: krops remoteCommand: don't ssh if target is local --- pkgs/krops/default.nix | 21 ++++++++++++--------- 1 file 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}"), -- cgit v1.2.3