2024-01-28 05:11:23 +01:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
|
|
|
frequency = "monthly";
|
2024-10-21 12:29:57 +02:00
|
|
|
randomizedDelaySec = "42min";
|
2024-07-23 03:51:02 +02:00
|
|
|
options = "--delete-older-than 30d --max-freed $((64 * 1024**3))";
|
2024-01-28 05:11:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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}
|
2024-07-31 08:27:17 +02:00
|
|
|
|
|
|
|
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}
|
2024-01-28 05:11:23 +01:00
|
|
|
'';
|
|
|
|
}
|