Merge #16422: httpd service: add phpPackage option

+13 -2
+13 -2
nixos/modules/services/web-servers/apache-httpd/default.nix
··· 12 12 13 13 httpdConf = mainCfg.configFile; 14 14 15 - php = pkgs.php.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ }; 15 + php = mainCfg.phpPackage.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ }; 16 + 17 + phpMajorVersion = head (splitString "." php.version); 16 18 17 19 getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80; 18 20 ··· 338 340 concatMap (svc: svc.extraModulesPre) allSubservices 339 341 ++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules 340 342 ++ optional mainCfg.enableMellon { name = "auth_mellon"; path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; } 341 - ++ optional enablePHP { name = "php5"; path = "${php}/modules/libphp5.so"; } 343 + ++ optional enablePHP { name = "php${phpMajorVersion}"; path = "${php}/modules/libphp${phpMajorVersion}.so"; } 342 344 ++ concatMap (svc: svc.extraModules) allSubservices 343 345 ++ extraForeignModules; 344 346 in concatMapStrings load allModules ··· 552 554 type = types.bool; 553 555 default = false; 554 556 description = "Whether to enable the PHP module."; 557 + }; 558 + 559 + phpPackage = mkOption { 560 + type = types.package; 561 + default = pkgs.php; 562 + defaultText = "pkgs.php"; 563 + description = '' 564 + Overridable attribute of the PHP package to use. 565 + ''; 555 566 }; 556 567 557 568 phpOptions = mkOption {