summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-07-03 17:40:54 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-07-03 17:40:54 +0200
commit95be4a4979aa8695f64a5be85d6f337285473d55 (patch)
tree917f9f8cd9690b3609e6c0aaaf109493f7ab2636 /nixos
parentca61557581e7bb7c4f4f8648436241623fd8a939 (diff)
parentff074ec7a4833e4db104423827001c28c6dd2074 (diff)
downloadnixlib-95be4a4979aa8695f64a5be85d6f337285473d55.tar
nixlib-95be4a4979aa8695f64a5be85d6f337285473d55.tar.gz
nixlib-95be4a4979aa8695f64a5be85d6f337285473d55.tar.bz2
nixlib-95be4a4979aa8695f64a5be85d6f337285473d55.tar.lz
nixlib-95be4a4979aa8695f64a5be85d6f337285473d55.tar.xz
nixlib-95be4a4979aa8695f64a5be85d6f337285473d55.tar.zst
nixlib-95be4a4979aa8695f64a5be85d6f337285473d55.zip
Merge #16422: httpd service: add phpPackage option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix
index 9844e3c435d1..397857ea0858 100644
--- a/nixos/modules/services/web-servers/apache-httpd/default.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/default.nix
@@ -12,7 +12,9 @@ let
 
   httpdConf = mainCfg.configFile;
 
-  php = pkgs.php.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ };
+  php = mainCfg.phpPackage.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ };
+
+  phpMajorVersion = head (splitString "." php.version);
 
   getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80;
 
@@ -338,7 +340,7 @@ let
           concatMap (svc: svc.extraModulesPre) allSubservices
           ++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules
           ++ optional mainCfg.enableMellon { name = "auth_mellon"; path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; }
-          ++ optional enablePHP { name = "php5"; path = "${php}/modules/libphp5.so"; }
+          ++ optional enablePHP { name = "php${phpMajorVersion}"; path = "${php}/modules/libphp${phpMajorVersion}.so"; }
           ++ concatMap (svc: svc.extraModules) allSubservices
           ++ extraForeignModules;
       in concatMapStrings load allModules
@@ -554,6 +556,15 @@ in
         description = "Whether to enable the PHP module.";
       };
 
+      phpPackage = mkOption {
+        type = types.package;
+        default = pkgs.php;
+        defaultText = "pkgs.php";
+        description = ''
+          Overridable attribute of the PHP package to use.
+        '';
+      };
+
       phpOptions = mkOption {
         type = types.lines;
         default = "";