darwin: auto-expire old home-manager generations
Alan Pearce alan@alanpearce.eu
Sun, 02 Apr 2023 20:26:42 +0200
1 files changed, 23 insertions(+), 0 deletions(-)
jump to
M user/settings/darwin.nix → user/settings/darwin.nix
@@ -42,6 +42,29 @@ programs.emacs.package = pkgs.emacs; home.file.".hushlogin".text = ""; + launchd.agents = { + home-manager-expire-generations = { + enable = true; + + config = { + ProgramArguments = [ + "${pkgs.home-manager}/bin/home-manager" + "expire-generations" + "-30 days" + ]; + KeepAlive = false; + RunAtLoad = false; + StartCalendarInterval = [{ + Hour = 12; + Minute = 00; + Weekday = 6; # Saturday + }]; + ProcessType = "Background"; + LowPriorityBackgroundIO = true; + }; + }; + }; + programs.zsh.shellAliases = { da = "darwin-rebuild"; das = "darwin-rebuild switch";