poppy: add weekly nix GC launchd agent (delete-older-than 14d)
nix.gc.automatic requires nix.enable=true, but poppy uses the Determinate nix installer (nix.enable=false). Define a launchd user agent directly that runs nix-collect-garbage --delete-older-than 14d weekly at Sun 03:00.
This commit is contained in:
parent
fcb6f67cab
commit
0fe7665072
1 changed files with 19 additions and 0 deletions
|
|
@ -20,6 +20,25 @@
|
|||
nixpkgs.config.allowUnfree = true;
|
||||
nix.enable = false;
|
||||
|
||||
# Автоматический сбор мусора: удалять пути старше 14 дней, по ночам в 3:00.
|
||||
# nix.gc не работает с nix.enable=false, поэтому launchd-агент напрямую.
|
||||
launchd.user.agents.nix-gc = {
|
||||
serviceConfig = {
|
||||
Label = "local.nix.gc";
|
||||
ProgramArguments = [
|
||||
"/nix/var/nix/profiles/default/bin/nix-collect-garbage"
|
||||
"--delete-older-than"
|
||||
"14d"
|
||||
];
|
||||
StartCalendarInterval = {
|
||||
Weekday = 0;
|
||||
Hour = 3;
|
||||
};
|
||||
StandardOutPath = "/tmp/nix-gc.log";
|
||||
StandardErrorPath = "/tmp/nix-gc.log";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.mikl = {
|
||||
home = "/Users/mikl";
|
||||
shell = pkgs.zsh;
|
||||
|
|
|
|||
Loading…
Reference in a new issue