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;
21 example = ["--debug"];
24 config = mkIf cfg.enable {
25 services.dbus.packages = [ dbusServiceFile ];
26 systemd.user.services.mmsd = {
27 after = [ "ModemManager.service" ];
28 aliases = [ "dbus-org.ofono.mms.service" ];
31 ExecStart = "${pkgs.mmsd-tng}/bin/mmsdtng " + escapeShellArgs cfg.extraArgs;
32 BusName = "org.ofono.mms";
33 Restart = "on-failure";