mfi: relocatable data dir

+10
+10
nixos/modules/services/networking/mfi.nix
··· 10 { what = "${pkgs.mfi}/dl"; where = "${stateDir}/dl"; } 11 { what = "${pkgs.mfi}/lib"; where = "${stateDir}/lib"; } 12 { what = "${pkgs.mongodb248}/bin"; where = "${stateDir}/bin"; } 13 ]; 14 systemdMountPoints = map (m: "${utils.escapeSystemdPath m.where}.mount") mountPoints; 15 ports = [ 6080 6880 6443 6843 ]; ··· 22 type = types.bool; 23 default = true; 24 description = "Whether to open TCP ports ${concatMapStrings (a: "${toString a} ") ports}for the services."; 25 }; 26 }; 27 };
··· 10 { what = "${pkgs.mfi}/dl"; where = "${stateDir}/dl"; } 11 { what = "${pkgs.mfi}/lib"; where = "${stateDir}/lib"; } 12 { what = "${pkgs.mongodb248}/bin"; where = "${stateDir}/bin"; } 13 + { what = "${cfg.dataDir}"; where = "${stateDir}/data"; } 14 ]; 15 systemdMountPoints = map (m: "${utils.escapeSystemdPath m.where}.mount") mountPoints; 16 ports = [ 6080 6880 6443 6843 ]; ··· 23 type = types.bool; 24 default = true; 25 description = "Whether to open TCP ports ${concatMapStrings (a: "${toString a} ") ports}for the services."; 26 + }; 27 + dataDir = mkOption { 28 + type = types.str; 29 + default = "${stateDir}/data"; 30 + description = '' 31 + Where to store the database and other data. 32 + 33 + This directory will be bind-mounted to ${stateDir}/data as part of the service startup. 34 + ''; 35 }; 36 }; 37 };