pkgs.krops.rebuild: allow passing arbitrary args

This commit is contained in:
tv 2019-02-26 19:50:53 +01:00
parent ba211472ef
commit 5dd80e884a
1 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@ in
{ exec, nix, openssh, populate, writeDash }: rec { { exec, nix, openssh, populate, writeDash }: rec {
rebuild = target: rebuild = args: target:
exec "rebuild.${target.host}" rec { exec "rebuild.${target.host}" rec {
filename = "${openssh}/bin/ssh"; filename = "${openssh}/bin/ssh";
argv = [ argv = [
@ -12,7 +12,9 @@ in
"-l" target.user "-l" target.user
"-p" target.port "-p" target.port
target.host target.host
"nixos-rebuild switch -I ${lib.escapeShellArg target.path}" "nixos-rebuild -I ${lib.escapeShellArg target.path} ${
lib.concatMapStringsSep " " lib.escapeShellArg args
}"
]; ];
}; };
@ -22,7 +24,7 @@ in
writeDash name '' writeDash name ''
set -efu set -efu
${populate { inherit force source; target = target'; }} ${populate { inherit force source; target = target'; }}
${rebuild target'} ${rebuild ["switch"] target'}
''; '';
writeTest = name: { force ? false, source, target }: let writeTest = name: { force ? false, source, target }: let