diff options
author | lassulus <lassulus@lassul.us> | 2018-09-29 20:44:50 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2018-09-29 20:44:50 +0200 |
commit | 913e7b41bb3cb562d6224e30094e8123f09b366f (patch) | |
tree | 1dc2760f5d1454b82be43f9c2f7949f2a3fed8b6 /pkgs/krops | |
parent | 7e1bcc4d4ba3d30d29d3f7c6b49eadedde2da98e (diff) | |
parent | 5b27dc84c8dc2fd104393ef5b3574469e1617fea (diff) |
Merge remote-tracking branch 'ni/master' into HEAD
Diffstat (limited to 'pkgs/krops')
-rw-r--r-- | pkgs/krops/default.nix | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index d2f9c8a..2d3395d 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -2,7 +2,19 @@ let lib = import ../../lib; in -{ nix, openssh, populate, writeDash, writeJSON }: { +{ exec, nix, openssh, populate, writeDash }: rec { + + rebuild = target: + exec "rebuild.${target.host}" rec { + filename = "${openssh}/bin/ssh"; + argv = [ + filename + "-l" target.user + "-p" target.port + target.host + "nixos-rebuild switch -I ${lib.escapeShellArg target.path}" + ]; + }; writeDeploy = name: { source, target }: let target' = lib.mkTarget target; @@ -10,9 +22,7 @@ in writeDash name '' set -efu ${populate { inherit source; target = target'; }} - ${openssh}/bin/ssh \ - ${target'.user}@${target'.host} -p ${target'.port} \ - nixos-rebuild switch -I ${target'.path} + ${rebuild target'} ''; writeTest = name: { source, target }: let @@ -23,12 +33,11 @@ in set -efu ${populate { inherit source; target = target'; }} ${nix}/bin/nix-build \ - -A config.system.build.toplevel \ + -A system \ -I ${target'.path} \ - --arg modules '[<nixos-config>]' \ --no-out-link \ --show-trace \ - '<nixpkgs/nixos/lib/eval-config.nix>' + '<nixpkgs/nixos>' ''; } |