about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-07-03 12:18:27 -0400
committerAaron Andersen <aaron@fosslib.net>2019-08-23 07:54:51 -0400
commit2b5f6630154ac569ed503c2fd944c7c83aa05778 (patch)
treee28841383356f6a4bb923f47fad0eee7dffe7422 /nixos
parent0ce8317c469872bcb4aed577477676d4148aa1a6 (diff)
downloadnixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.tar
nixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.tar.gz
nixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.tar.bz2
nixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.tar.lz
nixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.tar.xz
nixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.tar.zst
nixlib-2b5f6630154ac569ed503c2fd944c7c83aa05778.zip
nixos/phpfpm: merge pool-options.nix into default.nix
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/phpfpm/default.nix54
-rw-r--r--nixos/modules/services/web-servers/phpfpm/pool-options.nix57
2 files changed, 51 insertions, 60 deletions
diff --git a/nixos/modules/services/web-servers/phpfpm/default.nix b/nixos/modules/services/web-servers/phpfpm/default.nix
index 9db3a058d6da..a96ac052d005 100644
--- a/nixos/modules/services/web-servers/phpfpm/default.nix
+++ b/nixos/modules/services/web-servers/phpfpm/default.nix
@@ -29,6 +29,56 @@ let
     cat $phpPackage/etc/php.ini $nixDefaultsPath $phpOptionsPath > $out
   '';
 
+  poolOpts = { lib, ... }:
+    {
+      options = {
+        listen = mkOption {
+          type = types.str;
+          example = "/path/to/unix/socket";
+          description = ''
+            The address on which to accept FastCGI requests.
+          '';
+        };
+
+        phpPackage = mkOption {
+          type = types.package;
+          default = cfg.phpPackage;
+          defaultText = "config.services.phpfpm.phpPackage";
+          description = ''
+            The PHP package to use for running this PHP-FPM pool.
+          '';
+        };
+
+        phpOptions = mkOption {
+          type = types.lines;
+          default = cfg.phpOptions;
+          defaultText = "config.services.phpfpm.phpOptions";
+          description = ''
+            "Options appended to the PHP configuration file <filename>php.ini</filename> used for this PHP-FPM pool."
+          '';
+        };
+
+        extraConfig = mkOption {
+          type = types.lines;
+          example = ''
+            user = nobody
+            pm = dynamic
+            pm.max_children = 75
+            pm.start_servers = 10
+            pm.min_spare_servers = 5
+            pm.max_spare_servers = 20
+            pm.max_requests = 500
+          '';
+
+          description = ''
+            Extra lines that go into the pool configuration.
+            See the documentation on <literal>php-fpm.conf</literal> for
+            details on configuration directives.
+          '';
+        };
+      };
+    };
+
 in {
 
   options = {
@@ -66,9 +116,7 @@ in {
       };
 
       pools = mkOption {
-        type = types.attrsOf (types.submodule (import ./pool-options.nix {
-          inherit lib config;
-        }));
+        type = types.attrsOf (types.submodule poolOpts);
         default = {};
         example = literalExample ''
          {
diff --git a/nixos/modules/services/web-servers/phpfpm/pool-options.nix b/nixos/modules/services/web-servers/phpfpm/pool-options.nix
deleted file mode 100644
index d9ad7eff71f2..000000000000
--- a/nixos/modules/services/web-servers/phpfpm/pool-options.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ lib, config }:
-
-let
-  fpmCfg = config.services.phpfpm;
-in
-
-with lib; {
-
-  options = {
-
-    listen = mkOption {
-      type = types.str;
-      example = "/path/to/unix/socket";
-      description = ''
-        The address on which to accept FastCGI requests.
-      '';
-    };
-
-    phpPackage = mkOption {
-      type = types.package;
-      default = fpmCfg.phpPackage;
-      defaultText = "config.services.phpfpm.phpPackage";
-      description = ''
-        The PHP package to use for running this PHP-FPM pool.
-      '';
-    };
-
-    phpOptions = mkOption {
-      type = types.lines;
-      default = fpmCfg.phpOptions;
-      defaultText = "config.services.phpfpm.phpOptions";
-      description = ''
-        "Options appended to the PHP configuration file <filename>php.ini</filename> used for this PHP-FPM pool."
-      '';
-    };
-
-    extraConfig = mkOption {
-      type = types.lines;
-      example = ''
-        user = nobody
-        pm = dynamic
-        pm.max_children = 75
-        pm.start_servers = 10
-        pm.min_spare_servers = 5
-        pm.max_spare_servers = 20
-        pm.max_requests = 500
-      '';
-
-      description = ''
-        Extra lines that go into the pool configuration.
-        See the documentation on <literal>php-fpm.conf</literal> for
-        details on configuration directives.
-      '';
-    };
-  };
-}
-