mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-10 18:57:22 +00:00
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
37 lines
905 B
Nix
37 lines
905 B
Nix
{
|
|
nix.gc = {
|
|
automatic = true;
|
|
frequency = "monthly";
|
|
randomizedDelaySec = "42min";
|
|
options = "--delete-older-than 30d --max-freed $((64 * 1024**3))";
|
|
};
|
|
|
|
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}
|
|
'';
|
|
}
|