1
0
Fork 0
mirror of https://cgit.krebsco.de/krops synced 2024-11-26 21:19:47 +01:00

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

View file

@ -4,7 +4,7 @@ in
{ exec, nix, openssh, populate, writeDash }: rec {
rebuild = target:
rebuild = args: target:
exec "rebuild.${target.host}" rec {
filename = "${openssh}/bin/ssh";
argv = [
@ -12,7 +12,9 @@ in
"-l" target.user
"-p" target.port
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 ''
set -efu
${populate { inherit force source; target = target'; }}
${rebuild target'}
${rebuild ["switch"] target'}
'';
writeTest = name: { force ? false, source, target }: let