From 08546d3a20c915fb6554d68b3de89a1f2c0a1faa Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Fri, 22 Apr 2016 22:39:28 -0700 Subject: [PATCH 1/3] unifi: fix for closure-size changes --- nixos/modules/services/networking/unifi.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/unifi.nix b/nixos/modules/services/networking/unifi.nix index 4dc0cd96904..782dced33df 100644 --- a/nixos/modules/services/networking/unifi.nix +++ b/nixos/modules/services/networking/unifi.nix @@ -62,7 +62,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 From 86357de0c8d971f968b776abfc9f556b759f0ed2 Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Fri, 22 Apr 2016 22:43:45 -0700 Subject: [PATCH 2/3] mfi: relocatable data dir --- nixos/modules/services/networking/mfi.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/services/networking/mfi.nix b/nixos/modules/services/networking/mfi.nix index 5afb83ed022..775564a2c44 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. + ''; + }; }; }; From 032f3e721c1259b8a65f2bbe9f6c3a4d1994719f Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Fri, 22 Apr 2016 22:43:55 -0700 Subject: [PATCH 3/3] unifi: relocatable data dir --- nixos/modules/services/networking/unifi.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/modules/services/networking/unifi.nix b/nixos/modules/services/networking/unifi.nix index 782dced33df..cb5a88e67aa 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 {