mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
modules: add mkPackageOptionMD
another transitional option factory, like mkAliasOptionModuleMD.
This commit is contained in:
parent
4c1cfbdb84
commit
9da5f12ecf
23 changed files with 42 additions and 24 deletions
|
@ -136,7 +136,7 @@ rec {
|
|||
let default' = if !isList default then [ default ] else default;
|
||||
in mkOption {
|
||||
type = lib.types.package;
|
||||
description = lib.mdDoc "The ${name} package to use.";
|
||||
description = "The ${name} package to use.";
|
||||
default = attrByPath default'
|
||||
(throw "${concatStringsSep "." default'} cannot be found in pkgs") pkgs;
|
||||
defaultText = literalExpression ("pkgs." + concatStringsSep "." default');
|
||||
|
@ -144,6 +144,11 @@ rec {
|
|||
(if isList example then "pkgs." + concatStringsSep "." example else example);
|
||||
};
|
||||
|
||||
/* Like mkPackageOption, but emit an mdDoc description instead of DocBook. */
|
||||
mkPackageOptionMD = args: name: extra:
|
||||
let option = mkPackageOption args name extra;
|
||||
in option // { description = lib.mdDoc option.description; };
|
||||
|
||||
/* This option accepts anything, but it does not produce any result.
|
||||
|
||||
This is useful for sharing a module across different module sets
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue