1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

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:
‮rekcäH nitraM‮ 2025-03-24 21:44:21 +01:00
parent 8246e9dc79
commit e8f9cf2e2e

View file

@ -159,7 +159,15 @@ in
'';
};
config = mkIf cfg.enable {
config = mkMerge [
# get rid of /nix/store external directory when disabled
(mkIf (!cfg.enable) {
system.activationScripts.preActivation.text = ''
rm -rf ${cfg.workingDirectory}
'';
})
# normal config when enabled
(mkIf cfg.enable {
assertions = [
{
assertion = config.nix.enable;
@ -223,5 +231,6 @@ in
}];
nix.settings.builders-use-substitutes = true;
};
})
];
}