mediatomb/gerbera: Add missing types to options

This also fixes some various small limitations:
- Drop unnecessary quoting
- Drop duplicated gerbera interface definition
- Fix configuration indentation
This commit is contained in:
Antoine R. Dumont (@ardumont) 2020-07-18 20:58:11 +02:00 committed by Antoine R. Dumont (@ardumont)
parent fcb38d6773
commit 86e56d5322
No known key found for this signature in database
GPG Key ID: 52E2E9840D10C3B8

View File

@ -68,7 +68,6 @@ let
configText = optionalString (! cfg.customCfg) '' configText = optionalString (! cfg.customCfg) ''
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd"> <config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd">
<interface>${cfg.interface}</interface>
<server> <server>
<ui enabled="yes" show-tooltips="yes"> <ui enabled="yes" show-tooltips="yes">
<accounts enabled="no" session-timeout="30"> <accounts enabled="no" session-timeout="30">
@ -268,16 +267,19 @@ in {
}; };
user = mkOption { user = mkOption {
type = types.str;
default = "mediatomb"; default = "mediatomb";
description = "User account under which ${name} runs."; description = "User account under which ${name} runs.";
}; };
group = mkOption { group = mkOption {
type = types.str;
default = "mediatomb"; default = "mediatomb";
description = "Group account under which ${name} runs."; description = "Group account under which ${name} runs.";
}; };
port = mkOption { port = mkOption {
type = types.int;
default = 49152; default = 49152;
description = '' description = ''
The network port to listen on. The network port to listen on.
@ -285,6 +287,7 @@ in {
}; };
interface = mkOption { interface = mkOption {
type = types.str;
default = ""; default = "";
description = '' description = ''
A specific interface to bind to. A specific interface to bind to.
@ -292,6 +295,7 @@ in {
}; };
uuid = mkOption { uuid = mkOption {
type = types.str;
default = "fdfc8a4e-a3ad-4c1d-b43d-a2eedb03a687"; default = "fdfc8a4e-a3ad-4c1d-b43d-a2eedb03a687";
description = '' description = ''
A unique (on your network) to identify the server by. A unique (on your network) to identify the server by.
@ -335,7 +339,7 @@ in {
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "${binaryCommand} --port ${toString cfg.port} ${interfaceFlag} ${configFlag} --home ${cfg.dataDir}"; serviceConfig.ExecStart = "${binaryCommand} --port ${toString cfg.port} ${interfaceFlag} ${configFlag} --home ${cfg.dataDir}";
serviceConfig.User = "${cfg.user}"; serviceConfig.User = cfg.user;
}; };
users.groups = optionalAttrs (cfg.group == "mediatomb") { users.groups = optionalAttrs (cfg.group == "mediatomb") {
@ -346,7 +350,7 @@ in {
mediatomb = { mediatomb = {
isSystemUser = true; isSystemUser = true;
group = cfg.group; group = cfg.group;
home = "${cfg.dataDir}"; home = cfg.dataDir;
createHome = true; createHome = true;
description = "${name} DLNA Server User"; description = "${name} DLNA Server User";
}; };