1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

hyprsunset: fixed evaluation when hyprland package is null

This commit is contained in:
Ev357 2025-09-06 17:31:28 +02:00 committed by Austin Horstman
parent fc2fe0104d
commit ea3fe2bd72

View file

@ -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: