fnott: add D-Bus service file

This is needed to make fnott bus-activatable. Otherwise it won't be
started when a bus request is made [0]. Done in the same way as e.g.
dunst sets that up [1,2].

[0] https://www.freedesktop.org/software/systemd/man/systemd.service.html#id-1.10.6
[1] https://github.com/nix-community/home-manager/blob/master/modules/services/dunst.nix#L139
[2] https://github.com/dunst-project/dunst/blob/master/org.knopwob.dunst.service.in
This commit is contained in:
Christoph Heiss 2023-04-20 15:48:56 +02:00 committed by Robert Helgesson
parent 64d1f75a1e
commit 3895469036
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
3 changed files with 15 additions and 0 deletions

View File

@ -107,6 +107,13 @@ in {
};
};
xdg.dataFile."dbus-1/services/fnott.service".text = ''
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=${cfg.package}/bin/fnott
SystemdService=fnott.service
'';
xdg.configFile."fnott/fnott.ini".source =
iniFormat.generate "fnott.ini" cfg.settings;
};

View File

@ -0,0 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=@fnott@/bin/fnott
SystemdService=fnott.service

View File

@ -11,6 +11,10 @@
assertFileContent \
home-files/.config/systemd/user/fnott.service \
${./systemd-user-service-expected.service}
assertFileContent \
home-files/.local/share/dbus-1/services/fnott.service \
${./systemd-user-dbus-service-expected.service}
'';
};
}