diff options
author | Graham Christensen <graham@grahamc.com> | 2017-12-23 07:19:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 07:19:45 -0500 |
commit | b5a61f2c599ac665e3c3129258ea8671cb5760af (patch) | |
tree | ac16b806bfd54846edba76b0f21ff5d929570ff4 /lib/options.nix | |
parent | d3a0eb320a5e28a19b82f813e001fa832d7ef1d3 (diff) | |
download | nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.gz nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.bz2 nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.lz nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.xz nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.zst nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.zip |
Revert "nixos: doc: implement related packages in the manual"
Diffstat (limited to 'lib/options.nix')
-rw-r--r-- | lib/options.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/options.nix b/lib/options.nix index ab1201c718a..769d3cc5572 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -14,7 +14,6 @@ rec { , defaultText ? null # Textual representation of the default, for in the manual. , example ? null # Example value used in the manual. , description ? null # String describing the option. - , relatedPackages ? null # Related packages used in the manual. , type ? null # Option type, providing type-checking and value merging. , apply ? null # Function that converts the option value to something else. , internal ? null # Whether the option is for NixOS developers only. @@ -77,6 +76,7 @@ rec { getValues = map (x: x.value); getFiles = map (x: x.file); + # Generate documentation template from the list of option declaration like # the set generated with filterOptionSets. optionAttrSetToDocList = optionAttrSetToDocList' []; @@ -93,10 +93,9 @@ rec { readOnly = opt.readOnly or false; type = opt.type.description or null; } - // optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; } - // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; } - // optionalAttrs (opt ? defaultText) { default = opt.defaultText; } - // optionalAttrs (opt ? relatedPackages && opt.relatedPackages != null) { inherit (opt) relatedPackages; }; + // (if opt ? example then { example = scrubOptionValue opt.example; } else {}) + // (if opt ? default then { default = scrubOptionValue opt.default; } else {}) + // (if opt ? defaultText then { default = opt.defaultText; } else {}); subOptions = let ss = opt.type.getSubOptions opt.loc; |