diff options
author | Eric Litak <elitak@gmail.com> | 2016-04-22 22:43:55 -0700 |
---|---|---|
committer | Eric Litak <elitak@gmail.com> | 2016-04-22 22:43:55 -0700 |
commit | 032f3e721c1259b8a65f2bbe9f6c3a4d1994719f (patch) | |
tree | 8e59042d4516d13ffc9560e091a50cc33717b8a0 /nixos/modules | |
parent | 86357de0c8d971f968b776abfc9f556b759f0ed2 (diff) | |
download | nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.tar nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.tar.gz nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.tar.bz2 nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.tar.lz nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.tar.xz nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.tar.zst nixlib-032f3e721c1259b8a65f2bbe9f6c3a4d1994719f.zip |
unifi: relocatable data dir
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/networking/unifi.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/unifi.nix b/nixos/modules/services/networking/unifi.nix index 782dced33dfb..cb5a88e67aae 100644 --- a/nixos/modules/services/networking/unifi.nix +++ b/nixos/modules/services/networking/unifi.nix @@ -17,6 +17,10 @@ let what = "${pkgs.mongodb}/bin"; where = "${stateDir}/bin"; } + { + what = "${cfg.dataDir}"; + where = "${stateDir}/data"; + } ]; systemdMountPoints = map (m: "${utils.escapeSystemdPath m.where}.mount") mountPoints; in @@ -32,6 +36,16 @@ in ''; }; + services.unifi.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. + ''; + }; + }; config = mkIf cfg.enable { |