mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 15:19:45 +01:00
6843538e68
The nix-gc service runs automatically at a specified frequency. It is managed via launchd on macOS and systemd on Linux.
29 lines
591 B
Nix
29 lines
591 B
Nix
{ ... }:
|
|
|
|
{
|
|
nix.gc = {
|
|
automatic = true;
|
|
frequency = "monthly";
|
|
options = "--delete-older-than 30d";
|
|
};
|
|
|
|
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}
|
|
'';
|
|
}
|