]> Git — Sourcephile - julm/julm-nix.git/blob - nixpkgs/patches/mmsd.diff
clipster: enable
[julm/julm-nix.git] / nixpkgs / patches / mmsd.diff
1 diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
2 index ad0679d6165..cf593ad6aa9 100644
3 --- a/nixos/modules/module-list.nix
4 +++ b/nixos/modules/module-list.nix
5 @@ -856,7 +856,9 @@
6 ./services/networking/mjpg-streamer.nix
7 ./services/networking/minidlna.nix
8 ./services/networking/miniupnpd.nix
9 - ./services/networking/mosquitto.nix
10 + ./services/networking/miredo.nix
11 + ./services/networking/mjpg-streamer.nix
12 + ./services/networking/mmsd.nix
13 ./services/networking/monero.nix
14 ./services/networking/morty.nix
15 ./services/networking/mozillavpn.nix
16 diff --git a/nixos/modules/services/networking/mmsd.nix b/nixos/modules/services/networking/mmsd.nix
17 new file mode 100644
18 index 00000000000..7e262a9326c
19 --- /dev/null
20 +++ b/nixos/modules/services/networking/mmsd.nix
21 @@ -0,0 +1,38 @@
22 +{ pkgs, lib, config, ... }:
23 +with lib;
24 +let
25 + cfg = config.services.mmsd;
26 + dbusServiceFile = pkgs.writeTextDir "share/dbus-1/services/org.ofono.mms.service" ''
27 + [D-BUS Service]
28 + Name=org.ofono.mms
29 + SystemdService=dbus-org.ofono.mms.service
30 +
31 + # Exec= is still required despite SystemdService= being used:
32 + # https://github.com/freedesktop/dbus/blob/ef55a3db0d8f17848f8a579092fb05900cc076f5/test/data/systemd-activation/com.example.SystemdActivatable1.service
33 + Exec=${pkgs.coreutils}/bin/false mmsd
34 + '';
35 +in
36 +{
37 + options.services.mmsd = {
38 + enable = mkEnableOption (mdDoc "Multimedia Messaging Service Daemon");
39 + extraArgs = mkOption {
40 + type = with types; listOf str;
41 + description = mdDoc "Extra arguments passed to `mmsd-tng`";
42 + default = [];
43 + example = ["--debug"];
44 + };
45 + };
46 + config = mkIf cfg.enable {
47 + services.dbus.packages = [ dbusServiceFile ];
48 + systemd.user.services.mmsd = {
49 + after = [ "ModemManager.service" ];
50 + aliases = [ "dbus-org.ofono.mms.service" ];
51 + serviceConfig = {
52 + Type = "dbus";
53 + ExecStart = "${pkgs.mmsd-tng}/bin/mmsdtng " + escapeShellArgs cfg.extraArgs;
54 + BusName = "org.ofono.mms";
55 + Restart = "on-failure";
56 + };
57 + };
58 + };
59 +}
60 diff --git a/pkgs/tools/networking/mmsd-tng/default.nix b/pkgs/tools/networking/mmsd-tng/default.nix
61 new file mode 100644
62 index 00000000000..eaf12263751
63 --- /dev/null
64 +++ b/pkgs/tools/networking/mmsd-tng/default.nix
65 @@ -0,0 +1,53 @@
66 +{ lib, stdenv
67 +, fetchFromGitLab
68 +, c-ares
69 +, dbus
70 +, glib
71 +, libphonenumber
72 +, libsoup
73 +, meson
74 +, mobile-broadband-provider-info
75 +, modemmanager
76 +, ninja
77 +, pkg-config
78 +, protobuf
79 +}:
80 +
81 +stdenv.mkDerivation rec {
82 + pname = "mmsd-tng";
83 + version = "1.12.1";
84 +
85 + src = fetchFromGitLab {
86 + owner = "kop316";
87 + repo = "mmsd";
88 + rev = version;
89 + sha256 = "sha256-fhbiTJWmQwJpuMaVX2qWyWwJ/2Y/Vczo//+0T0b6jhA=";
90 + };
91 +
92 + nativeBuildInputs = [
93 + meson
94 + ninja
95 + pkg-config
96 + ];
97 +
98 + buildInputs = [
99 + c-ares
100 + dbus
101 + glib
102 + libphonenumber
103 + libsoup
104 + mobile-broadband-provider-info
105 + modemmanager
106 + protobuf
107 + ];
108 +
109 + doCheck = true;
110 +
111 + meta = with lib; {
112 + description = "Multimedia Messaging Service Daemon - The Next Generation";
113 + homepage = "https://gitlab.com/kop316/mmsd";
114 + license = licenses.gpl2Plus;
115 + maintainers = with maintainers; [ julm ];
116 + platforms = platforms.linux;
117 + };
118 +}
119 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
120 index dc456b3848e..9cf798e033d 100644
121 --- a/pkgs/top-level/all-packages.nix
122 +++ b/pkgs/top-level/all-packages.nix
123 @@ -30199,6 +30199,8 @@ with pkgs;
124
125 mmsd = callPackage ../tools/networking/mmsd { };
126
127 + mmsd-tng = callPackage ../tools/networking/mmsd-tng { };
128 +
129 mmtc = callPackage ../applications/audio/mmtc { };
130
131 mnamer = callPackage ../applications/misc/mnamer { };