From 2e751c0772b9d48ff6923569adfa661b030ab6a2 Mon Sep 17 00:00:00 2001 From: pennae Date: Thu, 28 Jul 2022 23:19:15 +0200 Subject: treewide: automatically md-convert option descriptions the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like and , so any option using such tags will not be converted at all. --- .../services/web-servers/phpfpm/default.nix | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'nixos/modules/services/web-servers/phpfpm/default.nix') diff --git a/nixos/modules/services/web-servers/phpfpm/default.nix b/nixos/modules/services/web-servers/phpfpm/default.nix index 87c68fa074a..e24c77d056a 100644 --- a/nixos/modules/services/web-servers/phpfpm/default.nix +++ b/nixos/modules/services/web-servers/phpfpm/default.nix @@ -51,7 +51,7 @@ let type = types.str; default = ""; example = "/path/to/unix/socket"; - description = '' + description = lib.mdDoc '' The address on which to accept FastCGI requests. ''; }; @@ -60,22 +60,22 @@ let type = types.package; default = cfg.phpPackage; defaultText = literalExpression "config.services.phpfpm.phpPackage"; - description = '' + description = lib.mdDoc '' The PHP package to use for running this PHP-FPM pool. ''; }; phpOptions = mkOption { type = types.lines; - description = '' - "Options appended to the PHP configuration file php.ini used for this PHP-FPM pool." + description = lib.mdDoc '' + "Options appended to the PHP configuration file {file}`php.ini` used for this PHP-FPM pool." ''; }; phpEnv = lib.mkOption { type = with types; attrsOf str; default = {}; - description = '' + description = lib.mdDoc '' Environment variables used for this PHP-FPM pool. ''; example = literalExpression '' @@ -90,22 +90,22 @@ let user = mkOption { type = types.str; - description = "User account under which this pool runs."; + description = lib.mdDoc "User account under which this pool runs."; }; group = mkOption { type = types.str; - description = "Group account under which this pool runs."; + description = lib.mdDoc "Group account under which this pool runs."; }; settings = mkOption { type = with types; attrsOf (oneOf [ str int bool ]); default = {}; - description = '' + description = lib.mdDoc '' PHP-FPM pool directives. Refer to the "List of pool directives" section of - + for details. Note that settings names must be enclosed in quotes (e.g. - "pm.max_children" instead of pm.max_children). + `"pm.max_children"` instead of `pm.max_children`). ''; example = literalExpression '' { @@ -122,9 +122,9 @@ let extraConfig = mkOption { type = with types; nullOr lines; default = null; - description = '' + description = lib.mdDoc '' Extra lines that go into the pool configuration. - See the documentation on php-fpm.conf for + See the documentation on `php-fpm.conf` for details on configuration directives. ''; }; @@ -154,24 +154,24 @@ in { settings = mkOption { type = with types; attrsOf (oneOf [ str int bool ]); default = {}; - description = '' + description = lib.mdDoc '' PHP-FPM global directives. Refer to the "List of global php-fpm.conf directives" section of - + for details. Note that settings names must be enclosed in quotes (e.g. - "pm.max_children" instead of pm.max_children). - You need not specify the options error_log or - daemonize here, since they are generated by NixOS. + `"pm.max_children"` instead of `pm.max_children`). + You need not specify the options `error_log` or + `daemonize` here, since they are generated by NixOS. ''; }; extraConfig = mkOption { type = with types; nullOr lines; default = null; - description = '' + description = lib.mdDoc '' Extra configuration that should be put in the global section of the PHP-FPM configuration file. Do not specify the options - error_log or - daemonize here, since they are generated by + `error_log` or + `daemonize` here, since they are generated by NixOS. ''; }; @@ -180,7 +180,7 @@ in { type = types.package; default = pkgs.php; defaultText = literalExpression "pkgs.php"; - description = '' + description = lib.mdDoc '' The PHP package to use for running the PHP-FPM service. ''; }; @@ -192,8 +192,8 @@ in { '' date.timezone = "CET" ''; - description = '' - Options appended to the PHP configuration file php.ini. + description = lib.mdDoc '' + Options appended to the PHP configuration file {file}`php.ini`. ''; }; @@ -216,7 +216,7 @@ in { }; } }''; - description = '' + description = lib.mdDoc '' PHP-FPM pools. If no pools are defined, the PHP-FPM service is disabled. ''; -- cgit 1.4.1