mirror of
https://github.com/nix-community/home-manager
synced 2024-12-26 03:39:47 +01:00
6cc03e337a
There's no launchd equivalent to this option, so this is a no-op on Darwin.
41 lines
954 B
Nix
41 lines
954 B
Nix
{ ... }:
|
|
|
|
{
|
|
nix.gc = {
|
|
automatic = true;
|
|
frequency = "monthly";
|
|
randomizedDelaySec = "42min";
|
|
options = "--delete-older-than 30d --max-freed $((64 * 1024**3))";
|
|
};
|
|
|
|
test.stubs.nix = { name = "nix"; };
|
|
|
|
nmt.script = ''
|
|
serviceFile=home-files/.config/systemd/user/nix-gc.service
|
|
|
|
assertFileExists $serviceFile
|
|
|
|
serviceFile=$(normalizeStorePaths $serviceFile)
|
|
|
|
assertFileContent $serviceFile ${./expected.service}
|
|
|
|
timerFile=home-files/.config/systemd/user/nix-gc.timer
|
|
|
|
assertFileExists $timerFile
|
|
|
|
timerFile=$(normalizeStorePaths $timerFile)
|
|
|
|
assertFileContent $timerFile ${./expected.timer}
|
|
|
|
nixgcScriptFile=$(grep -o \
|
|
'/nix/store/.*-nix-gc' \
|
|
$TESTED/home-files/.config/systemd/user/nix-gc.service
|
|
)
|
|
|
|
assertFileExists $nixgcScriptFile
|
|
|
|
nixgcScriptFile=$(normalizeStorePaths $nixgcScriptFile)
|
|
|
|
assertFileContent $nixgcScriptFile ${./nix-gc-script-expected}
|
|
'';
|
|
}
|