1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

swaync: allow systemd target to be changed

This commit is contained in:
Ersei Saggi 2024-10-17 23:58:13 -04:00
parent a4353cc43d
commit 61837c3f42
No known key found for this signature in database
GPG key ID: 023FF4C1A9D6BAFD
2 changed files with 10 additions and 7 deletions

View file

@ -73,6 +73,15 @@ in {
for the documentation.
'';
};
systemdTarget = lib.mkOption {
type = lib.types.str;
default = "graphical-session.target";
example = "sway-session.target";
description = ''
Systemd target to bind to.
'';
};
};
config = lib.mkIf cfg.enable {
@ -95,9 +104,6 @@ in {
Unit = {
Description = "Swaync notification daemon";
Documentation = "https://github.com/ErikReider/SwayNotificationCenter";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
ConditionEnvironment = "WAYLAND_DISPLAY";
};
Service = {
@ -107,7 +113,7 @@ in {
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
Install.WantedBy = [ cfg.systemdTarget ];
};
};
}

View file

@ -24,11 +24,8 @@
Type=dbus
[Unit]
After=graphical-session-pre.target
ConditionEnvironment=WAYLAND_DISPLAY
Description=Swaync notification daemon
Documentation=https://github.com/ErikReider/SwayNotificationCenter
PartOf=graphical-session.target
''
}
'';