From 1ba3165b4e95fccbb9d46429b5557966a05c3420 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 28 May 2010 11:20:45 +0000 Subject: [PATCH] * Allow the default for option values displayed in the manual to be overriden. Some defaults should not be evaluated because they cause unnecessary evaluation or might cause evaluation errors (e.g. assertions). For instance, the value of the `boot.kernelPackages' option is an attribute set. Some packages in that set might not evaluate (e.g. AUFS2 on kernels that don't have the AUFS2 patch), and in any case it slows down nixos-rebuild to evaluate lots of packages that are not actually used in the configuration. svn path=/nixpkgs/trunk/; revision=22043 --- pkgs/lib/options.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index 3db9b671fe3..570be886552 100644 --- a/pkgs/lib/options.nix +++ b/pkgs/lib/options.nix @@ -263,7 +263,8 @@ rec { definitions = map (x: toString x.source) opt.definitions; } // optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; } - // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; }; + // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; } + // optionalAttrs (opt ? defaultText) { default = opt.defaultText; }; subOptions = if opt ? options then