NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.98k stars 13.99k forks source link

Jami daemon as a service #166542

Open Munksgaard opened 2 years ago

Munksgaard commented 2 years ago

Jami daemon as a service

In addition to various clients, we currently package jami-daemon, although it's not really usable in it's current form. For one, it doesn't output the binary in the bin folder as you'd expect, meaning that jamid is not correctly brought into scope. Instead the binary resides in libexec. Apart from fixing this, though, jami-daemon would be much more usable if it was a service you could enable.

Metadata

afreakk commented 2 years ago

Adding jami-daemon to dbus.packages, seems to work fine. I've got this config at the moment, which causes jami-daemon to be started on demand when I start jami-qt

  environment.systemPackages = [ pkgs.jami-client-qt pkgs.jami-daemon ];
  services.dbus.enable = true;
  services.dbus.packages = [ pkgs.jami-daemon ];
  systemd.packages = [ pkgs.jami-daemon ];

(Maybe I have more than the minimal necessary things here)

dbus.service runs jamid, and it knows its in libexec, so that seems correct. Output of systemctl status:

 └─session.slice
   ├─dbus.service
   │ └─489656 /nix/store/gydcfdph2ly7ix4f6ci5q2v2q11yd270-jami-daemon-20220726.1515.da8d1da/libexec/jamid

So making a module similar to https://github.com/NixOS/nixpkgs/blob/6d5bbc70068b815d855573190f0ed4e6ce83639e/nixos/modules/services/desktops/neard.nix would maybe be a good idea.