move minidlna to its own module

This commit is contained in:
2024-08-03 07:03:15 +03:00
parent a6169de898
commit ebd263189e
3 changed files with 40 additions and 18 deletions

View File

@@ -12,6 +12,7 @@
./headscale
./jakstpub
./matrix-synapse
./minidlna
./node_exporter
./nsd-acme
./photoprism

View File

@@ -0,0 +1,33 @@
{ config, lib, ... }:
let
cfg = config.mj.services.minidlna;
in
{
options.mj.services.minidlna = with lib.types; {
enable = lib.mkEnableOption "Enable minidlna";
paths = lib.mkOption { type = listOf path; };
};
config = {
services.minidlna = {
enable = true;
openFirewall = true;
settings = {
media_dir = cfg.paths;
friendly_name = "${config.networking.hostName}.${config.networking.domain}";
inotify = "yes";
};
};
systemd.services.minidlna = {
serviceConfig = {
ProtectSystem = "strict";
ProtectHome = "tmpfs";
BindReadOnlyPaths = cfg.paths;
};
};
};
}