1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

nix-gc: remove extraneous quotes from shell script

This commit is contained in:
William Tan 2024-07-31 02:27:17 -04:00 committed by GitHub
parent 4fcd54df7c
commit 58cef37962
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View file

@ -111,10 +111,10 @@ in {
Unit = { Description = "Nix Garbage Collector"; }; Unit = { Description = "Nix Garbage Collector"; };
Service = { Service = {
Type = "oneshot"; Type = "oneshot";
ExecStart = toString (pkgs.writeShellScript "nix-gc" '' ExecStart = toString (pkgs.writeShellScript "nix-gc"
exec "${nixPackage}/bin/nix-collect-garbage ${ "exec ${nixPackage}/bin/nix-collect-garbage ${
lib.optionalString (cfg.options != null) cfg.options lib.optionalString (cfg.options != null) cfg.options
}"''); }");
}; };
}; };
systemd.user.timers.nix-gc = { systemd.user.timers.nix-gc = {

View file

@ -25,5 +25,16 @@
timerFile=$(normalizeStorePaths $timerFile) timerFile=$(normalizeStorePaths $timerFile)
assertFileContent $timerFile ${./expected.timer} 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}
''; '';
} }

View file

@ -0,0 +1,2 @@
#!/nix/store/00000000000000000000000000000000-bash/bin/bash
exec @nix@/bin/nix-collect-garbage --delete-older-than 30d --max-freed $((64 * 1024**3))