1 { pkgs, lib, config, ... }:
4 cfg = config.services.mmsd;
5 dbusServiceFile = pkgs.writeTextDir "share/dbus-1/services/org.ofono.mms.service" ''
8 SystemdService=dbus-org.ofono.mms.service
10 # Exec= is still required despite SystemdService= being used:
11 # https://github.com/freedesktop/dbus/blob/ef55a3db0d8f17848f8a579092fb05900cc076f5/test/data/systemd-activation/com.example.SystemdActivatable1.service
12 Exec=${pkgs.coreutils}/bin/false mmsd
16 options.services.mmsd = {
17 enable = mkEnableOption "Multimedia Messaging Service Daemon";
18 extraArgs = mkOption {
19 type = with types; listOf str;
20 description = "Extra arguments passed to `mmsd-tng`";
22 example = ["--debug"];
25 config = mkIf cfg.enable {
26 services.dbus.packages = [ dbusServiceFile ];
27 systemd.user.services.mmsd = {
28 after = [ "ModemManager.service" ];
29 aliases = [ "dbus-org.ofono.mms.service" ];
32 ExecStart = "${pkgs.mmsd-tng}/bin/mmsdtng " + escapeShellArgs cfg.extraArgs;
33 BusName = "org.ofono.mms";
34 Restart = "on-failure";