9 cfg = config.services.gmediarender;
12 options.services.gmediarender = {
13 enable = lib.mkEnableOption "the gmediarender DLNA renderer";
15 audioDevice = lib.mkOption {
16 type = lib.types.nullOr lib.types.str;
19 The audio device to use.
23 audioSink = lib.mkOption {
24 type = lib.types.nullOr lib.types.str;
27 The audio sink to use.
31 friendlyName = lib.mkOption {
32 type = lib.types.nullOr lib.types.str;
35 A "friendly name" for identifying the endpoint.
39 initialVolume = lib.mkOption {
40 type = lib.types.nullOr lib.types.int;
43 A default volume attenuation (in dB) for the endpoint.
47 package = lib.mkPackageOption pkgs "gmediarender" {
48 default = "gmrender-resurrect";
52 type = lib.types.nullOr lib.types.port;
54 description = "Port that will be used to accept client connections.";
58 type = lib.types.nullOr lib.types.str;
61 A UUID for uniquely identifying the endpoint. If you have
62 multiple renderers on your network, you MUST set this.
67 config = lib.mkIf cfg.enable {
69 services.gmediarender = {
70 wants = [ "network-online.target" ];
71 after = [ "network-online.target" ];
72 wantedBy = [ "multi-user.target" ];
73 description = "gmediarender server daemon";
75 XDG_CACHE_HOME = "%t/gmediarender";
79 User = "gmediarender";
80 Group = "gmediarender";
81 SupplementaryGroups = [ "audio" ];
83 "${cfg.package}/bin/gmediarender "
84 + lib.optionalString (cfg.audioDevice != null) (
85 "--gstout-audiodevice=${utils.escapeSystemdExecArg cfg.audioDevice} "
87 + lib.optionalString (cfg.audioSink != null) (
88 "--gstout-audiosink=${utils.escapeSystemdExecArg cfg.audioSink} "
90 + lib.optionalString (cfg.friendlyName != null) (
91 "--friendly-name=${utils.escapeSystemdExecArg cfg.friendlyName} "
93 + lib.optionalString (cfg.initialVolume != 0) ("--initial-volume=${toString cfg.initialVolume} ")
94 + lib.optionalString (cfg.port != null) ("--port=${toString cfg.port} ")
95 + lib.optionalString (cfg.uuid != null) ("--uuid=${utils.escapeSystemdExecArg cfg.uuid} ");
97 RuntimeDirectory = "gmediarender";
100 CapabilityBoundingSet = "";
101 LockPersonality = true;
102 MemoryDenyWriteExecute = true;
103 NoNewPrivileges = true;
104 # PrivateDevices = true;
109 ProtectControlGroups = true;
111 ProtectHostname = true;
112 ProtectKernelLogs = true;
113 ProtectKernelModules = true;
114 ProtectKernelTunables = true;
115 ProtectProc = "invisible";
116 RestrictNamespaces = true;
117 RestrictRealtime = true;
118 RestrictSUIDSGID = true;
119 SystemCallArchitectures = "native";