about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@users.noreply.github.com>2016-04-23 19:06:51 +0200
committerJoachim Fasting <joachifm@users.noreply.github.com>2016-04-23 19:06:51 +0200
commit1dde66596f93aa7055fd2553a1d5023eb2472c87 (patch)
treefe6cea4c01d12e859b76addbea1a65dee90c4dc1 /nixos
parent25d18f400f400d6739b116814a792871af79b14c (diff)
parent032f3e721c1259b8a65f2bbe9f6c3a4d1994719f (diff)
downloadnixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.tar
nixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.tar.gz
nixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.tar.bz2
nixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.tar.lz
nixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.tar.xz
nixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.tar.zst
nixlib-1dde66596f93aa7055fd2553a1d5023eb2472c87.zip
Merge pull request #14915 from elitak/unifi
unifi, mfi: closure-size fix, relocatable data dir
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/mfi.nix10
-rw-r--r--nixos/modules/services/networking/unifi.nix16
2 files changed, 25 insertions, 1 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.
+        '';
+      };
     };
   };
 
diff --git a/nixos/modules/services/networking/unifi.nix b/nixos/modules/services/networking/unifi.nix
index 4dc0cd96904c..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 {
@@ -62,7 +76,7 @@ in
       bindsTo = systemdMountPoints;
       unitConfig.RequiresMountsFor = stateDir;
       # This a HACK to fix missing dependencies of dynamic libs extracted from jars
-      environment.LD_LIBRARY_PATH = with pkgs.stdenv; "${cc.cc}/lib";
+      environment.LD_LIBRARY_PATH = with pkgs.stdenv; "${cc.cc.lib}/lib";
 
       preStart = ''
         # Ensure privacy of state