mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-05 00:21:04 +01:00
tests/nix-gc: reorganize darwin and linux
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
7a64c02340
commit
41a5f0a98a
11 changed files with 9 additions and 10 deletions
37
tests/modules/services/nix-gc/linux/basic.nix
Normal file
37
tests/modules/services/nix-gc/linux/basic.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
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}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue