From ea3fe2bd72caf2a0f75edf3cf9ece8d60c2f9557 Mon Sep 17 00:00:00 2001 From: Ev357 Date: Sat, 6 Sep 2025 17:31:28 +0200 Subject: [PATCH] hyprsunset: fixed evaluation when hyprland package is null --- modules/services/hyprsunset.nix | 42 +++++++++++++++++---------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/modules/services/hyprsunset.nix b/modules/services/hyprsunset.nix index df0ec9c57..995f6f36f 100644 --- a/modules/services/hyprsunset.nix +++ b/modules/services/hyprsunset.nix @@ -200,28 +200,30 @@ in }; }; } - // lib.optionalAttrs (config.wayland.windowManager.hyprland.package != null) lib.mapAttrs' ( - name: transitionCfg: - lib.nameValuePair "hyprsunset-${name}" { - Install = { }; + // lib.optionalAttrs (config.wayland.windowManager.hyprland.package != null) ( + lib.mapAttrs' ( + name: transitionCfg: + lib.nameValuePair "hyprsunset-${name}" { + Install = { }; - Unit = { - ConditionEnvironment = "WAYLAND_DISPLAY"; - Description = "hyprsunset transition for ${name}"; - After = [ "hyprsunset.service" ]; - Requires = [ "hyprsunset.service" ]; - }; + Unit = { + ConditionEnvironment = "WAYLAND_DISPLAY"; + Description = "hyprsunset transition for ${name}"; + After = [ "hyprsunset.service" ]; + Requires = [ "hyprsunset.service" ]; + }; - Service = { - Type = "oneshot"; - # Execute multiple requests sequentially - ExecStart = lib.concatMapStringsSep " && " ( - cmd: - "${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} hyprsunset ${lib.escapeShellArgs cmd}" - ) transitionCfg.requests; - }; - } - ) cfg.transitions; + Service = { + Type = "oneshot"; + # Execute multiple requests sequentially + ExecStart = lib.concatMapStringsSep " && " ( + cmd: + "${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} hyprsunset ${lib.escapeShellArgs cmd}" + ) transitionCfg.requests; + }; + } + ) cfg.transitions + ); timers = lib.mapAttrs' ( name: transitionCfg: