From 0fe7665072bbe71eb8b4b469a65ff090f8cc6e48 Mon Sep 17 00:00:00 2001 From: mikl Date: Thu, 16 Jul 2026 13:16:50 +0300 Subject: [PATCH] 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. --- hosts/poppy/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hosts/poppy/default.nix b/hosts/poppy/default.nix index cf6ccb3..ca63f44 100644 --- a/hosts/poppy/default.nix +++ b/hosts/poppy/default.nix @@ -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;