Merge #12796: nixos docs: show references to packages

(version 2) A better implementation of #10039, after #12357.
This time I did more thorough checking.

See commit messages for details.

+35 -27
+1 -2
nixos/modules/programs/ssh.nix
··· 36 36 37 37 askPassword = mkOption { 38 38 type = types.str; 39 + default = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; 39 40 description = ''Program used by SSH to ask for passwords.''; 40 41 }; 41 42 ··· 225 226 ''; 226 227 227 228 environment.variables.SSH_ASKPASS = optionalString config.services.xserver.enable askPassword; 228 - 229 - programs.ssh.askPassword = mkDefault "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; 230 229 231 230 }; 232 231 }
+1 -2
nixos/modules/programs/venus.nix
··· 99 99 }; 100 100 101 101 outputTheme = mkOption { 102 + default = "${pkgs.venus}/themes/classic_fancy"; 102 103 type = types.path; 103 104 description = '' 104 105 Directory containing a config.ini file which is merged with this one. ··· 167 168 serviceConfig.Group = "${cfg.group}"; 168 169 startAt = cfg.dates; 169 170 }; 170 - 171 - services.venus.outputTheme = mkDefault "${pkgs.venus}/themes/classic_fancy"; 172 171 173 172 }; 174 173 }
+1 -2
nixos/modules/services/amqp/activemq/default.nix
··· 32 32 ''; 33 33 }; 34 34 configurationDir = mkOption { 35 + default = "${activemq}/conf"; 35 36 description = '' 36 37 The base directory for ActiveMQ's configuration. 37 38 By default, this directory is searched for a file named activemq.xml, ··· 124 125 ${cfg.extraJavaOptions} ActiveMQBroker "${cfg.configurationURI}" 125 126 ''; 126 127 }; 127 - 128 - services.activemq.configurationDir = mkDefault "${activemq}/conf"; 129 128 130 129 }; 131 130
+23 -8
nixos/modules/services/misc/nixos-manual.nix
··· 17 17 nixpkgs.system = config.nixpkgs.system; 18 18 }; 19 19 20 - eval = evalModules { 21 - modules = [ versionModule ] ++ baseModules; 22 - args = (config._module.args) // { modules = [ ]; }; 23 - }; 24 - 20 + /* For the purpose of generating docs, evaluate options with each derivation 21 + in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}". 22 + It isn't perfect, but it seems to cover a vast majority of use cases. 23 + Caveat: even if the package is reached by a different means, 24 + the path above will be shown and not e.g. `${config.services.foo.package}`. */ 25 25 manual = import ../../../doc/manual { 26 26 inherit pkgs; 27 27 version = config.system.nixosVersion; 28 28 revision = config.system.nixosRevision; 29 - options = eval.options; 29 + options = 30 + let 31 + scrubbedEval = evalModules { 32 + modules = [ versionModule ] ++ baseModules; 33 + args = (config._module.args) // { modules = [ ]; }; 34 + specialArgs = { pkgs = scrubDerivations "pkgs" pkgs; }; 35 + }; 36 + scrubDerivations = namePrefix: pkgSet: mapAttrs 37 + (name: value: 38 + let wholeName = "${namePrefix}.${name}"; in 39 + if isAttrs value then 40 + scrubDerivations wholeName value 41 + // (optionalAttrs (isDerivation value) { outPath = "\${${wholeName}}"; }) 42 + else value 43 + ) 44 + pkgSet; 45 + in scrubbedEval.options; 30 46 }; 31 47 32 48 entry = "${manual.manual}/share/doc/nixos/index.html"; ··· 81 97 82 98 services.nixosManual.browser = mkOption { 83 99 type = types.path; 100 + default = "${pkgs.w3m-nox}/bin/w3m"; 84 101 description = '' 85 102 Browser used to show the manual. 86 103 ''; ··· 117 134 118 135 services.mingetty.helpLine = mkIf cfg.showManual 119 136 "\nPress <Alt-F${toString cfg.ttyNumber}> for the NixOS manual."; 120 - 121 - services.nixosManual.browser = mkDefault "${pkgs.w3m-nox}/bin/w3m"; 122 137 123 138 }; 124 139
+1 -3
nixos/modules/services/misc/subsonic.nix
··· 97 97 98 98 transcoders = mkOption { 99 99 type = types.listOf types.path; 100 + default = [ "${pkgs.ffmpeg}/bin/ffmpeg" ]; 100 101 description = '' 101 102 List of paths to transcoder executables that should be accessible 102 103 from Subsonic. Symlinks will be created to each executable inside ··· 152 153 }; 153 154 154 155 users.extraGroups.subsonic.gid = config.ids.gids.subsonic; 155 - 156 - services.subsonic.transcoders = mkDefault [ "${pkgs.ffmpeg}/bin/ffmpeg" ]; 157 - 158 156 }; 159 157 }
+1 -3
nixos/modules/services/monitoring/grafana.nix
··· 87 87 88 88 staticRootPath = mkOption { 89 89 description = "Root path for static assets."; 90 + default = "${cfg.package.out}/share/grafana/public"; 90 91 type = types.str; 91 92 }; 92 93 ··· 232 233 home = cfg.dataDir; 233 234 createHome = true; 234 235 }; 235 - 236 - services.grafana.staticRootPath = mkDefault "${cfg.package}/share/grafana/public"; 237 - 238 236 }; 239 237 }
+4 -1
nixos/modules/services/networking/dnscrypt-proxy.nix
··· 52 52 default = "opendns"; 53 53 type = types.nullOr types.string; 54 54 description = '' 55 - The name of the upstream DNSCrypt resolver to use. 55 + The name of the upstream DNSCrypt resolver to use. See 56 + <literal>${resolverListFile}</literal> for alternative resolvers 57 + (e.g., if you are concerned about logging and/or server 58 + location). 56 59 ''; 57 60 }; 58 61 customResolver = mkOption {
+2 -3
nixos/modules/services/web-servers/phpfpm.nix
··· 46 46 47 47 phpIni = mkOption { 48 48 type = types.path; 49 - description = "PHP configuration file to use."; 49 + default = "${cfg.phpPackage}/etc/php-recommended.ini"; 50 + description = "php.ini file to use."; 50 51 }; 51 52 52 53 poolConfigs = mkOption { ··· 86 87 PIDFile = pidFile; 87 88 }; 88 89 }; 89 - 90 - services.phpfpm.phpIni = mkDefault "${cfg.phpPackage}/etc/php-recommended.ini"; 91 90 92 91 }; 93 92 }
+1 -3
nixos/modules/services/x11/display-managers/lightdm.nix
··· 87 87 88 88 background = mkOption { 89 89 type = types.str; 90 + default = "${pkgs.nixos-artwork}/share/artwork/gnome/Gnome_Dark.png"; 90 91 description = '' 91 92 The background image or color to use. 92 93 ''; ··· 152 153 }; 153 154 154 155 users.extraGroups.lightdm.gid = config.ids.gids.lightdm; 155 - 156 - services.xserver.displayManager.lightdm.background = mkDefault "${pkgs.nixos-artwork}/share/artwork/gnome/Gnome_Dark.png"; 157 - 158 156 services.xserver.tty = null; # We might start multiple X servers so let the tty increment themselves.. 159 157 services.xserver.display = null; # We specify our own display (and logfile) in xserver-wrapper up there 160 158 };