From c2d3a75ebe79f8b9f789725aae0e8f82ea31b3ad Mon Sep 17 00:00:00 2001 From: Benedikt Rips Date: Mon, 5 Jan 2026 16:17:05 +0100 Subject: [PATCH] home-manager-auto-expire: remove redundant platform checks --- modules/services/home-manager-auto-expire.nix | 68 ++++++++----------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/modules/services/home-manager-auto-expire.nix b/modules/services/home-manager-auto-expire.nix index 4f745370a..147fe3b51 100644 --- a/modules/services/home-manager-auto-expire.nix +++ b/modules/services/home-manager-auto-expire.nix @@ -81,46 +81,38 @@ in }; }; - config = lib.mkIf cfg.enable ( - lib.mkMerge [ - (lib.mkIf pkgs.stdenv.isLinux { - systemd.user = { - timers.home-manager-auto-expire = { - Unit.Description = "Home Manager expire generations timer"; + config = lib.mkIf cfg.enable { - Install.WantedBy = [ "timers.target" ]; - - Timer = { - OnCalendar = cfg.frequency; - Unit = "home-manager-auto-expire.service"; - Persistent = true; - }; - }; - - services.home-manager-auto-expire = { - Unit.Description = "Home Manager expire generations"; - - Service.ExecStart = toString script; - }; + systemd.user = { + timers.home-manager-auto-expire = { + Unit.Description = "Home Manager expire generations timer"; + Install.WantedBy = [ "timers.target" ]; + Timer = { + OnCalendar = cfg.frequency; + Unit = "home-manager-auto-expire.service"; + Persistent = true; }; - }) + }; + services.home-manager-auto-expire = { + Unit.Description = "Home Manager expire generations"; + Service.ExecStart = toString script; + }; + }; - (lib.mkIf pkgs.stdenv.isDarwin { - assertions = [ - (lib.hm.darwin.assertInterval "services.home-manager.autoExpire.frequency" cfg.frequency pkgs) - ]; + assertions = [ + (lib.hm.darwin.assertInterval "services.home-manager.autoExpire.frequency" cfg.frequency pkgs) + ]; - launchd.agents.home-manager-auto-expire = { - enable = true; - config = { - ProgramArguments = [ (toString script) ]; - ProcessType = "Background"; - StartCalendarInterval = lib.hm.darwin.mkCalendarInterval cfg.frequency; - StandardOutPath = "${config.home.homeDirectory}/Library/Logs/home-manager-auto-expire/launchd-stdout.log"; - StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/home-manager-auto-expire/launchd-stderr.log"; - }; - }; - }) - ] - ); + launchd.agents.home-manager-auto-expire = { + enable = true; + config = { + ProgramArguments = [ (toString script) ]; + ProcessType = "Background"; + StartCalendarInterval = lib.hm.darwin.mkCalendarInterval cfg.frequency; + StandardOutPath = "${config.home.homeDirectory}/Library/Logs/home-manager-auto-expire/launchd-stdout.log"; + StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/home-manager-auto-expire/launchd-stderr.log"; + }; + }; + + }; }