swayidle: allow wayland targets other than sway-session.target (#3202)

Allow another Wayland targets, as river-session.target or
hyprland-session.target, to use swayidle.service which is hard-coded to
sway-session.target.
This commit is contained in:
Erik Rodriguez 2022-09-05 13:56:10 -03:00 committed by GitHub
parent 140aaed3df
commit 583a99f016
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,6 +96,15 @@ in {
default = [ ];
description = "Extra arguments to pass to swayidle.";
};
systemdTarget = mkOption {
type = types.str;
default = "sway-session.target";
description = ''
Systemd target to bind to.
'';
};
};
config = mkIf cfg.enable {
@ -114,7 +123,7 @@ in {
"${cfg.package}/bin/swayidle -w ${concatStringsSep " " args}";
};
Install = { WantedBy = [ "sway-session.target" ]; };
Install = { WantedBy = [ cfg.systemdTarget ]; };
};
};
}