git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit3cf9cd8bc30c5e271822adaeb5069b19879acc8c authorVladimír Čunát <vcunat@gmail.com> dateSat 27 Feb 2016, 10:48 (11 years ago) parenta8b44c74fede53
9 files changed+35−27
nixos/modules/programs/ssh.nix+1−2 nixos/modules/programs/venus.nix+1−2 nixos/modules/services/amqp/activemq/default.nix+1−2 nixos/modules/services/misc/nixos-manual.nix+23−8 nixos/modules/services/misc/subsonic.nix+1−3 nixos/modules/services/monitoring/grafana.nix+1−3 nixos/modules/services/networking/dnscrypt-proxy.nix+4−1 nixos/modules/services/web-servers/phpfpm.nix+2−3 nixos/modules/services/x11/display-managers/lightdm.nix+1−3
nixos/modules/programs/ssh.nix+1−2
@@ -36,6 +36,7 @@ in
3636
3737 askPassword = mkOption {
3838 type = types.str;
39+ default = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass";
3940 description = ''Program used by SSH to ask for passwords.'';
4041 };
4142
@@ -226,7 +227,5 @@ in
226227
227228 environment.variables.SSH_ASKPASS = optionalString config.services.xserver.enable askPassword;
228229
229− programs.ssh.askPassword = mkDefault "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass";
230−
231230 };
232231}
nixos/modules/programs/venus.nix+1−2
@@ -99,6 +99,7 @@ in
9999 };
100100
101101 outputTheme = mkOption {
102+ default = "${pkgs.venus}/themes/classic_fancy";
102103 type = types.path;
103104 description = ''
104105 Directory containing a config.ini file which is merged with this one.
@@ -168,7 +169,5 @@ in
168169 startAt = cfg.dates;
169170 };
170171
171− services.venus.outputTheme = mkDefault "${pkgs.venus}/themes/classic_fancy";
172−
173172 };
174173}
nixos/modules/services/amqp/activemq/default.nix+1−2
@@ -32,6 +32,7 @@ in {
3232 '';
3333 };
3434 configurationDir = mkOption {
35+ default = "${activemq}/conf";
3536 description = ''
3637 The base directory for ActiveMQ's configuration.
3738 By default, this directory is searched for a file named activemq.xml,
@@ -125,8 +126,6 @@ in {
125126 '';
126127 };
127128
128− services.activemq.configurationDir = mkDefault "${activemq}/conf";
129−
130129 };
131130
132131}
nixos/modules/services/misc/nixos-manual.nix+23−8
@@ -17,16 +17,32 @@ let
1717 nixpkgs.system = config.nixpkgs.system;
1818 };
1919
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}`. */
2525 manual = import ../../../doc/manual {
2626 inherit pkgs;
2727 version = config.system.nixosVersion;
2828 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;
3046 };
3147
3248 entry = "${manual.manual}/share/doc/nixos/index.html";
@@ -81,6 +97,7 @@ in
8197
8298 services.nixosManual.browser = mkOption {
8399 type = types.path;
100+ default = "${pkgs.w3m-nox}/bin/w3m";
84101 description = ''
85102 Browser used to show the manual.
86103 '';
@@ -118,8 +135,6 @@ in
118135 services.mingetty.helpLine = mkIf cfg.showManual
119136 "\nPress <Alt-F${toString cfg.ttyNumber}> for the NixOS manual.";
120137
121− services.nixosManual.browser = mkDefault "${pkgs.w3m-nox}/bin/w3m";
122−
123138 };
124139
125140}
nixos/modules/services/misc/subsonic.nix+1−3
@@ -97,6 +97,7 @@ in
9797
9898 transcoders = mkOption {
9999 type = types.listOf types.path;
100+ default = [ "${pkgs.ffmpeg}/bin/ffmpeg" ];
100101 description = ''
101102 List of paths to transcoder executables that should be accessible
102103 from Subsonic. Symlinks will be created to each executable inside
@@ -152,8 +153,5 @@ in
152153 };
153154
154155 users.extraGroups.subsonic.gid = config.ids.gids.subsonic;
155−
156− services.subsonic.transcoders = mkDefault [ "${pkgs.ffmpeg}/bin/ffmpeg" ];
157−
158156 };
159157}
nixos/modules/services/monitoring/grafana.nix+1−3
@@ -87,6 +87,7 @@ in {
8787
8888 staticRootPath = mkOption {
8989 description = "Root path for static assets.";
90+ default = "${cfg.package.out}/share/grafana/public";
9091 type = types.str;
9192 };
9293
@@ -232,8 +233,5 @@ in {
232233 home = cfg.dataDir;
233234 createHome = true;
234235 };
235−
236− services.grafana.staticRootPath = mkDefault "${cfg.package}/share/grafana/public";
237−
238236 };
239237}
nixos/modules/services/networking/dnscrypt-proxy.nix+4−1
@@ -52,7 +52,10 @@ in
5252 default = "opendns";
5353 type = types.nullOr types.string;
5454 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).
5659 '';
5760 };
5861 customResolver = mkOption {
nixos/modules/services/web-servers/phpfpm.nix+2−3
@@ -46,7 +46,8 @@ in {
4646
4747 phpIni = mkOption {
4848 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.";
5051 };
5152
5253 poolConfigs = mkOption {
@@ -87,7 +88,5 @@ in {
8788 };
8889 };
8990
90− services.phpfpm.phpIni = mkDefault "${cfg.phpPackage}/etc/php-recommended.ini";
91−
9291 };
9392}
nixos/modules/services/x11/display-managers/lightdm.nix+1−3
@@ -87,6 +87,7 @@ in
8787
8888 background = mkOption {
8989 type = types.str;
90+ default = "${pkgs.nixos-artwork}/share/artwork/gnome/Gnome_Dark.png";
9091 description = ''
9192 The background image or color to use.
9293 '';
@@ -152,9 +153,6 @@ in
152153 };
153154
154155 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−
158156 services.xserver.tty = null; # We might start multiple X servers so let the tty increment themselves..
159157 services.xserver.display = null; # We specify our own display (and logfile) in xserver-wrapper up there
160158 };