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:
parent
8f096963ae
commit
5d72a29fc3
1 changed files with 11 additions and 3 deletions
|
|
@ -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}"
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue