linux-builder: remove /nix/store external directory when disabled
When /nix/store internal directories get renamed, they just don't get into the next version of your system closure and are thus no problem to rename. But state in the system is a problem, as there is no process to remov eit. Thus we need to do it ourselves.
This commit is contained in:
parent
a175c68f3f
commit
b8939c4fe4
1 changed files with 9 additions and 2 deletions
|
|
@ -159,7 +159,13 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = mkMerge [
|
||||
(mkIf (!cfg.enable) {
|
||||
system.activationScripts.preActivation.text = ''
|
||||
rm -rf ${cfg.workingDirectory}
|
||||
'';
|
||||
})
|
||||
(mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.nix.enable;
|
||||
|
|
@ -223,5 +229,6 @@ in
|
|||
}];
|
||||
|
||||
nix.settings.builders-use-substitutes = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue