nixos/minidlna: add package option

This commit is contained in:
Gautier DI FOLCO 2024-10-01 22:22:20 +02:00
parent 2b40f1b3c8
commit 5970720f1c
No known key found for this signature in database
GPG Key ID: 5E55C042F72B6D6B

View File

@ -21,6 +21,8 @@ in
'';
};
options.services.minidlna.package = lib.mkPackageOption pkgs "minidlna" { };
options.services.minidlna.openFirewall = mkOption {
type = types.bool;
default = false;
@ -141,7 +143,7 @@ in
CacheDirectory = "minidlna";
RuntimeDirectory = "minidlna";
PIDFile = "/run/minidlna/pid";
ExecStart = "${pkgs.minidlna}/sbin/minidlnad -S -P /run/minidlna/pid -f ${settingsFile}";
ExecStart = "${lib.getExe cfg.package} -S -P /run/minidlna/pid -f ${settingsFile}";
};
};
};