about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorEric Litak <elitak@gmail.com>2016-04-22 22:43:45 -0700
committerEric Litak <elitak@gmail.com>2016-04-22 22:43:45 -0700
commit86357de0c8d971f968b776abfc9f556b759f0ed2 (patch)
tree3a85d5d196e225cdda4939e384d6e2f084d1f77c /nixos/modules
parent08546d3a20c915fb6554d68b3de89a1f2c0a1faa (diff)
downloadnixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.tar
nixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.tar.gz
nixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.tar.bz2
nixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.tar.lz
nixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.tar.xz
nixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.tar.zst
nixlib-86357de0c8d971f968b776abfc9f556b759f0ed2.zip
mfi: relocatable data dir
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/networking/mfi.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/mfi.nix b/nixos/modules/services/networking/mfi.nix
index 5afb83ed022f..775564a2c446 100644
--- a/nixos/modules/services/networking/mfi.nix
+++ b/nixos/modules/services/networking/mfi.nix
@@ -10,6 +10,7 @@ let
     { what = "${pkgs.mfi}/dl"; where = "${stateDir}/dl"; }
     { what = "${pkgs.mfi}/lib"; where = "${stateDir}/lib"; }
     { what = "${pkgs.mongodb248}/bin"; where = "${stateDir}/bin"; }
+    { what = "${cfg.dataDir}"; where = "${stateDir}/data"; }
   ];
   systemdMountPoints = map (m: "${utils.escapeSystemdPath m.where}.mount") mountPoints;
   ports = [ 6080 6880 6443 6843 ];
@@ -23,6 +24,15 @@ in
         default = true;
         description = "Whether to open TCP ports ${concatMapStrings (a: "${toString a} ") ports}for the services.";
       };
+      dataDir = mkOption {
+        type = types.str;
+        default = "${stateDir}/data";
+        description = ''
+          Where to store the database and other data.
+
+          This directory will be bind-mounted to ${stateDir}/data as part of the service startup.
+        '';
+      };
     };
   };