diff options
author | Eric Sagnes <eric.sagnes@gmail.com> | 2016-04-29 15:26:20 +0900 |
---|---|---|
committer | Eric Sagnes <eric.sagnes@gmail.com> | 2016-04-29 15:26:20 +0900 |
commit | a8bc5b67f8caf82585932eab14cb99fcbc4d595b (patch) | |
tree | 46046662f9371543be3755241782aacb341ee0e1 /nixos/modules/services | |
parent | 44acb6833bfdac83495131f2bc5e7d3103a46863 (diff) | |
download | nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.tar nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.tar.gz nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.tar.bz2 nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.tar.lz nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.tar.xz nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.tar.zst nixlib-a8bc5b67f8caf82585932eab14cb99fcbc4d595b.zip |
php: add default php.ini
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/web-servers/apache-httpd/default.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/web-servers/phpfpm.nix | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 7953729c00cd..c23897192b4c 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -406,7 +406,7 @@ let ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices)); } '' - cat ${php}/etc/php-recommended.ini > $out + cat ${php}/etc/php.ini > $out echo "$options" >> $out ''; diff --git a/nixos/modules/services/web-servers/phpfpm.nix b/nixos/modules/services/web-servers/phpfpm.nix index 6a60000ce19e..2658d7117e37 100644 --- a/nixos/modules/services/web-servers/phpfpm.nix +++ b/nixos/modules/services/web-servers/phpfpm.nix @@ -19,6 +19,12 @@ let ${concatStringsSep "\n" (mapAttrsToList (n: v: "[${n}]\n${v}") cfg.poolConfigs)} ''; + phpIni = pkgs.writeText "php.ini" '' + ${readFile "${cfg.phpPackage}/etc/php.ini"} + + ${cfg.phpOptions} + ''; + in { options = { @@ -44,10 +50,15 @@ in { ''; }; - phpIni = mkOption { - type = types.path; - default = "${cfg.phpPackage}/etc/php-recommended.ini"; - description = "php.ini file to use."; + phpOptions = mkOption { + type = types.lines; + default = ""; + example = + '' + date.timezone = "CET" + ''; + description = + "Options appended to the PHP configuration file <filename>php.ini</filename>."; }; poolConfigs = mkOption { @@ -84,7 +95,7 @@ in { mkdir -p "${stateDir}" ''; serviceConfig = { - ExecStart = "${cfg.phpPackage}/sbin/php-fpm -y ${cfgFile} -c ${cfg.phpIni}"; + ExecStart = "${cfg.phpPackage}/bin/php-fpm -y ${cfgFile} -c ${phpIni}"; PIDFile = pidFile; }; }; |