diff --git a/nixos/modules/services/misc/mediatomb.nix b/nixos/modules/services/misc/mediatomb.nix
index e56e9d6e4ba..a06f6da7b23 100644
--- a/nixos/modules/services/misc/mediatomb.nix
+++ b/nixos/modules/services/misc/mediatomb.nix
@@ -9,6 +9,29 @@ let
name = cfg.package.pname;
pkg = cfg.package;
optionYesNo = option: if option then "yes" else "no";
+ # configuration on media directory
+ mediaDirectory = {
+ options = {
+ path = mkOption {
+ type = types.str;
+ description = ''
+ Absolute directory path to the media directory to index.
+ '';
+ };
+ recursive = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Whether the indexation must take place recursively or not.";
+ };
+ hidden-files = mkOption {
+ type = types.bool;
+ default = true;
+ description = "Whether to index the hidden files or not.";
+ };
+ };
+ };
+ toMediaDirectory = d: "\n";
+
transcodingConfig = if cfg.transcoding then with pkgs; ''
@@ -43,6 +66,10 @@ let
'';
mtConf = pkgs.writeText "config.xml" ''
+
${cfg.interface}
@@ -85,6 +112,9 @@ let
+
+ ${concatMapStrings toMediaDirectory cfg.mediaDirectories}
+
${pkg}/share/${name}/js/common.js
${pkg}/share/${name}/js/playlists.js
@@ -272,6 +302,18 @@ in {
'';
};
+ mediaDirectories = mkOption {
+ type = with types; listOf (submodule mediaDirectory);
+ default = {};
+ description = ''
+ Declare media directories to index.
+ '';
+ example = [
+ { path = "/data/pictures"; recursive = false; hidden-files = false; }
+ { path = "/data/audio"; recursive = true; hidden-files = false; }
+ ];
+ };
+
customCfg = mkOption {
type = types.bool;
default = false;