tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
apache-httpd: add phpPackage option
Eric Sagnes
9 years ago
ff074ec7
d254e4de
+13
-2
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
web-servers
apache-httpd
default.nix
+13
-2
nixos/modules/services/web-servers/apache-httpd/default.nix
···
12
13
httpdConf = mainCfg.configFile;
14
15
-
php = pkgs.php.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ };
0
0
16
17
getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80;
18
···
338
concatMap (svc: svc.extraModulesPre) allSubservices
339
++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules
340
++ 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"; }
342
++ concatMap (svc: svc.extraModules) allSubservices
343
++ extraForeignModules;
344
in concatMapStrings load allModules
···
552
type = types.bool;
553
default = false;
554
description = "Whether to enable the PHP module.";
0
0
0
0
0
0
0
0
0
555
};
556
557
phpOptions = mkOption {
···
12
13
httpdConf = mainCfg.configFile;
14
15
+
php = mainCfg.phpPackage.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ };
16
+
17
+
phpMajorVersion = head (splitString "." php.version);
18
19
getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80;
20
···
340
concatMap (svc: svc.extraModulesPre) allSubservices
341
++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules
342
++ optional mainCfg.enableMellon { name = "auth_mellon"; path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; }
343
+
++ optional enablePHP { name = "php${phpMajorVersion}"; path = "${php}/modules/libphp${phpMajorVersion}.so"; }
344
++ concatMap (svc: svc.extraModules) allSubservices
345
++ extraForeignModules;
346
in concatMapStrings load allModules
···
554
type = types.bool;
555
default = false;
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
+
'';
566
};
567
568
phpOptions = mkOption {