1
0
Fork 0
mirror of https://cgit.krebsco.de/krops synced 2024-11-23 03:29:48 +01:00

pkgs write{Deploy,Test}: allow backup of target

This commit is contained in:
tv 2019-07-16 22:23:50 +02:00
parent 79aa2c6a88
commit 14a54637ce

View file

@ -36,24 +36,24 @@ in
];
};
writeDeploy = name: { force ? false, source, target }: let
writeDeploy = name: { backup ? false, force ? false, source, target }: let
target' = lib.mkTarget target;
in
writeDash name ''
set -efu
${populate { inherit force source; target = target'; }}
${populate { inherit backup force source; target = target'; }}
${rebuild ["dry-build"] target'}
${build target'}
${rebuild ["switch"] target'}
'';
writeTest = name: { force ? false, source, target }: let
writeTest = name: { backup ? false, force ? false, source, target }: let
target' = lib.mkTarget target;
in
assert lib.isLocalTarget target';
writeDash name ''
set -efu
${populate { inherit force source; target = target'; }} >&2
${populate { inherit backup force source; target = target'; }} >&2
NIX_PATH=${lib.escapeShellArg target'.path} \
${nix}/bin/nix-build \
-A system \