mirror of
https://cgit.krebsco.de/krops/
synced 2025-01-11 10:46:59 +00:00
pkgs write{Deploy,Test}: allow backup of target
This commit is contained in:
parent
79aa2c6a88
commit
14a54637ce
@ -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;
|
target' = lib.mkTarget target;
|
||||||
in
|
in
|
||||||
writeDash name ''
|
writeDash name ''
|
||||||
set -efu
|
set -efu
|
||||||
${populate { inherit force source; target = target'; }}
|
${populate { inherit backup force source; target = target'; }}
|
||||||
${rebuild ["dry-build"] target'}
|
${rebuild ["dry-build"] target'}
|
||||||
${build target'}
|
${build target'}
|
||||||
${rebuild ["switch"] target'}
|
${rebuild ["switch"] target'}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
writeTest = name: { force ? false, source, target }: let
|
writeTest = name: { backup ? false, force ? false, source, target }: let
|
||||||
target' = lib.mkTarget target;
|
target' = lib.mkTarget target;
|
||||||
in
|
in
|
||||||
assert lib.isLocalTarget target';
|
assert lib.isLocalTarget target';
|
||||||
writeDash name ''
|
writeDash name ''
|
||||||
set -efu
|
set -efu
|
||||||
${populate { inherit force source; target = target'; }} >&2
|
${populate { inherit backup force source; target = target'; }} >&2
|
||||||
NIX_PATH=${lib.escapeShellArg target'.path} \
|
NIX_PATH=${lib.escapeShellArg target'.path} \
|
||||||
${nix}/bin/nix-build \
|
${nix}/bin/nix-build \
|
||||||
-A system \
|
-A system \
|
||||||
|
Loading…
Reference in New Issue
Block a user