diff options
| author | lassulus <lassulus@lassul.us> | 2019-04-28 14:10:09 +0200 | 
|---|---|---|
| committer | lassulus <lassulus@lassul.us> | 2019-04-28 14:25:06 +0200 | 
| commit | ee41207df1ce718e0b154ed8047384118a0133a4 (patch) | |
| tree | 512a6ef3176d998eac5c351c02bbc0c4f6af8a9e | |
| parent | 219e5aa008e16d01ebaf76e71f08c82b3c9fb740 (diff) | |
writeDeploy: fancy output with nix buildv1.14.0
| -rw-r--r-- | pkgs/krops/default.nix | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index d5a75d7..f449474 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -4,6 +4,24 @@ in  { exec, nix, openssh, populate, writeDash }: rec { +  build = target: +    exec "rebuild.${target.host}" rec { +      filename = "${openssh}/bin/ssh"; +      argv = [ +        filename +        "-l" target.user +        "-p" target.port +        "-t" +        target.host +        (lib.concatStringsSep " " [ +          "nix build" +          "-I ${lib.escapeShellArg target.path}" +          "--no-link -f '<nixpkgs/nixos>'" +          "config.system.build.toplevel" +        ]) +      ]; +    }; +    rebuild = args: target:      exec "rebuild.${target.host}" rec {        filename = "${openssh}/bin/ssh"; @@ -24,6 +42,7 @@ in      writeDash name ''        set -efu        ${populate { inherit force source; target = target'; }} +      ${build target'}        ${rebuild ["switch"] target'}      ''; | 
