diff options
| author | Jörg Thalheim <joerg@thalheim.io> | 2020-06-22 15:38:35 +0100 | 
|---|---|---|
| committer | Jörg Thalheim <joerg@thalheim.io> | 2020-06-22 15:40:34 +0100 | 
| commit | bdf56191e2b78cee6a720fc63a0750a3bc4321e1 (patch) | |
| tree | 36a1b42e734be42ec71c2a16d27b50d6abf40353 | |
| parent | 56a066d4705f6f9f28b713e5f8a50a6596063dce (diff) | |
fix local deployment with sudo
| -rw-r--r-- | pkgs/krops/default.nix | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index ab74bc3..184a12a 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -18,8 +18,11 @@ in      }";    runShell = target: command: -    if lib.isLocalTarget target -      then command +    let +      command' = if target.sudo then "sudo ${command}" else command; +    in +      if lib.isLocalTarget target +      then command'        else          writers.writeDash "krops.${target.host}.${lib.firstWord command}" ''            exec ${openssh}/bin/ssh ${lib.escapeShellArgs (lib.flatten [ @@ -28,7 +31,7 @@ in              "-T"              target.extraOptions              target.host -            (if target.sudo then "sudo ${command}" else command)])} +            command'])}          '';    writeCommand = name: {  | 
