diff --git a/nixos/modules/services/networking/minidlna.nix b/nixos/modules/services/networking/minidlna.nix index bbbfe9d72e1a..61d063dbfe0e 100644 --- a/nixos/modules/services/networking/minidlna.nix +++ b/nixos/modules/services/networking/minidlna.nix @@ -60,7 +60,7 @@ in port=${toString port} friendly_name=${config.networking.hostName} MiniDLNA db_dir=/var/cache/minidlna - log_dir=/var/log/minidlna + log_level=warn inotify=yes ${concatMapStrings (dir: '' media_dir=${dir} @@ -83,21 +83,18 @@ in preStart = '' - mkdir -p /var/cache/minidlna /var/log/minidlna /run/minidlna - chown minidlna /var/cache/minidlna /var/log/minidlna /run/minidlna + mkdir -p /var/cache/minidlna + chown -R minidlna:minidlna /var/cache/minidlna ''; - # FIXME: log through the journal rather than - # /var/log/minidlna. The -d flag does that, but also raises - # the log level to debug... serviceConfig = { User = "minidlna"; - Group = "nogroup"; + Group = "minidlna"; PermissionsStartOnly = true; - Type = "forking"; + RuntimeDirectory = "minidlna"; PIDFile = "/run/minidlna/pid"; ExecStart = - "@${pkgs.minidlna}/sbin/minidlnad minidlnad -P /run/minidlna/pid" + + "${pkgs.minidlna}/sbin/minidlnad -S -P /run/minidlna/pid" + " -f ${pkgs.writeText "minidlna.conf" cfg.config}"; }; };