enhance phpIni documentation

readd r19267 (the issue should be fixed now)

Eelco Dolstra and Nicolas Pierron both kept asking me to pay attention
to the rendered manual. There is one catch: example settings such as
pkgs.kernelPackages_2_6_25 are correct however they don't render
properly. Moreover you don't want those examples to be evaluated (maybe
compiling a kernel ?) when building the manual only.
So use Strings and add a copy & paste note.
This is still a hacky. Maybe a kind of typed "verbatim" expression
should be added (?)

svn path=/nixos/trunk/; revision=19281
This commit is contained in:
Marc Weber 2010-01-07 09:01:40 +00:00
parent ac7c404deb
commit fdc63c54e4
2 changed files with 57 additions and 7 deletions

View file

@ -464,6 +464,56 @@ in
'';
};
phpIni = mkOption {
default = pkgs.writeText "php.ini" ''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
'';
example = ''
Example code (copy & paste):
most simple:
phpIni pkgs.writeText "php.ini" '''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
''';
using recommended settings and enabling Xdebug:
phpIni = pkgs.phpIniBuilder.override {
appendLines = '''
sendmail_path = sendmail -t -i
zend_extension="''\${pkgs.phpXdebug}/lib/xdebug.so"
zend_extension_ts="''\${pkgs.phpXdebug}/lib/xdebug.so"
zend_extension_debug="''\${pkgs.phpXdebug}/lib/xdebug.so"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.remote_mode=req
''';
};
'';
description = ''
The contents of this option are used as global php.ini file by the
PHP interpreter used by Apache. You have to enable PHP explicitly.
See extraModules options.
This file defaults to defining sendmail_path only.
Note: Depending on your configuration you can set PHP ini values using .htaccess files and the
php_value option.
The example shows how to enable Xdebug and use the recommended
php.ini values which are contained in the PHP distribution.
I don't know whether they are equal to defaults
'';
};
}
# Include the options shared between the main server and virtual hosts.
@ -520,12 +570,8 @@ in
optional config.networking.defaultMailServer.directDelivery "${pkgs.ssmtp}/sbin"
++ (concatMap (svc: svc.extraServerPath) allSubservices) );
PHPRC = pkgs.writeText "php.ini"
''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
'';
PHPRC = mainCfg.phpIni;
} // (listToAttrs (concatMap (svc: svc.globalEnvVars) allSubservices));
preStart =

View file

@ -12,7 +12,11 @@ let kernel = config.boot.kernelPackages.kernel; in
boot.kernelPackages = mkOption {
default = pkgs.kernelPackages;
example = pkgs.kernelPackages_2_6_25;
example = ''
Example code (copy & paste):
pkgs.kernelPackages_2_6_25
'';
description = ''
This option allows you to override the Linux kernel used by
NixOS. Since things like external kernel module packages are