From 032f3e721c1259b8a65f2bbe9f6c3a4d1994719f Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Fri, 22 Apr 2016 22:43:55 -0700 Subject: unifi: relocatable data dir --- nixos/modules/services/networking/unifi.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'nixos/modules') 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 { -- cgit 1.4.1