ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.15k stars 58 forks source link

NixOS systemd service; recommended? #399

Closed ndom91 closed 3 months ago

ndom91 commented 3 months ago

Hey folks, thanks for this great notification center!

I've been launching swaync through Hyprland's exec-once on startup. But I recenlty noticed that a user systemd service is shipped with the swaynotificationcenter nixpkg.

Do you recommend using that service file on nixos? If so, how would you enable it declaratively?

I'm relatively new to nixos, but setting systemd.services.swaync.enable = true; in configuration.nix doesn't seem to work, I assume it's got to be under home.nix or an import thereof to target the user systemd service, isntead of a (non-existent) system wide one?

EDIT: Nevermind, it does seem to work like so:

systemd.user.units.swaync.enable = true;
ndom91 commented 3 months ago

Ah okay, nevermind. After a few reboots (it seemed to work the first time :thinking:) It's now errorign with cannot open display :0

image

I assume I have to add WantedBy or After for hyprland.service.. will report back

EDIT: Hmm it already ships with After=graphical-session.target :thinking:

EDIT 2: I'm on systemd 254, so I'm assuming the CONDITION_ENVIRONMENT should be working too :thinking: :thinking:

will do some more digging..