From 3895469036e4f42ab4bb0482e18c3677e3fb12b1 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Thu, 20 Apr 2023 15:48:56 +0200 Subject: [PATCH] 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 --- modules/services/fnott.nix | 7 +++++++ .../fnott/systemd-user-dbus-service-expected.service | 4 ++++ tests/modules/services/fnott/systemd-user-service.nix | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 tests/modules/services/fnott/systemd-user-dbus-service-expected.service diff --git a/modules/services/fnott.nix b/modules/services/fnott.nix index aa9e91811..43be5d714 100644 --- a/modules/services/fnott.nix +++ b/modules/services/fnott.nix @@ -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; }; diff --git a/tests/modules/services/fnott/systemd-user-dbus-service-expected.service b/tests/modules/services/fnott/systemd-user-dbus-service-expected.service new file mode 100644 index 000000000..4abb28a70 --- /dev/null +++ b/tests/modules/services/fnott/systemd-user-dbus-service-expected.service @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.freedesktop.Notifications +Exec=@fnott@/bin/fnott +SystemdService=fnott.service diff --git a/tests/modules/services/fnott/systemd-user-service.nix b/tests/modules/services/fnott/systemd-user-service.nix index 7efa06435..ebb6bf004 100644 --- a/tests/modules/services/fnott/systemd-user-service.nix +++ b/tests/modules/services/fnott/systemd-user-service.nix @@ -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} ''; }; }