hypridle: add systemdTarget option (#7237)

This commit is contained in:
NukDokPlex
2025-06-08 20:20:52 +05:00
committed by GitHub
parent 06451df423
commit f23b0935a3

View File

@@ -74,6 +74,14 @@ in
List of prefix of attributes to source at the top of the config.
'';
};
systemdTarget = lib.mkOption {
type = lib.types.str;
default = config.wayland.systemd.target;
defaultText = lib.literalExpression "config.wayland.systemd.target";
example = "hyprland-session.target";
description = "Systemd target to bind to.";
};
};
config = lib.mkIf cfg.enable {
@@ -86,14 +94,14 @@ in
systemd.user.services.hypridle = lib.mkIf (cfg.package != null) {
Install = {
WantedBy = [ config.wayland.systemd.target ];
WantedBy = [ cfg.systemdTarget ];
};
Unit = {
ConditionEnvironment = "WAYLAND_DISPLAY";
Description = "hypridle";
After = [ config.wayland.systemd.target ];
PartOf = [ config.wayland.systemd.target ];
After = [ cfg.systemdTarget ];
PartOf = [ cfg.systemdTarget ];
X-Restart-Triggers = lib.mkIf (cfg.settings != { }) [
"${config.xdg.configFile."hypr/hypridle.conf".source}"
];