hyprpaper: add system target option

Adding option `systemdTarget` to hyprpaper to match other
wayland/hyprland modules. This allows easy fixup of startup dependencies
for the service, depending on system.
This commit is contained in:
Matej Blagšič 2026-06-29 18:13:51 +02:00 committed by GitHub
parent 8f096963ae
commit 5d72a29fc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,6 +71,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 {
@ -83,14 +91,14 @@ in
systemd.user.services.hyprpaper = lib.mkIf (cfg.package != null) {
Install = {
WantedBy = [ config.wayland.systemd.target ];
WantedBy = [ cfg.systemdTarget ];
};
Unit = {
ConditionEnvironment = "WAYLAND_DISPLAY";
Description = "hyprpaper";
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/hyprpaper.conf".source}"
];