mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nixos/manual: clarify mk{Enable,Package}Option MD usage
the examples were incorrect, but not catastrophically. running a docs build would've issued a warning with the correct instructions.
This commit is contained in:
parent
df09c21fb2
commit
ad8d5cf731
2 changed files with 6 additions and 6 deletions
|
@ -78,7 +78,7 @@ For example:
|
|||
|
||||
::: {#ex-options-declarations-util-mkEnableOption-magic .example}
|
||||
```nix
|
||||
lib.mkEnableOption "magic"
|
||||
lib.mkEnableOption (lib.mdDoc "magic")
|
||||
# is like
|
||||
lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
|
@ -113,7 +113,7 @@ Examples:
|
|||
|
||||
::: {#ex-options-declarations-util-mkPackageOption-hello .example}
|
||||
```nix
|
||||
lib.mkPackageOption pkgs "hello" { }
|
||||
lib.mkPackageOptionMD pkgs "hello" { }
|
||||
# is like
|
||||
lib.mkOption {
|
||||
type = lib.types.package;
|
||||
|
@ -125,7 +125,7 @@ lib.mkOption {
|
|||
|
||||
::: {#ex-options-declarations-util-mkPackageOption-ghc .example}
|
||||
```nix
|
||||
lib.mkPackageOption pkgs "GHC" {
|
||||
lib.mkPackageOptionMD pkgs "GHC" {
|
||||
default = [ "ghc" ];
|
||||
example = "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ options = {
|
|||
</para>
|
||||
<anchor xml:id="ex-options-declarations-util-mkEnableOption-magic" />
|
||||
<programlisting language="nix">
|
||||
lib.mkEnableOption "magic"
|
||||
lib.mkEnableOption (lib.mdDoc "magic")
|
||||
# is like
|
||||
lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
|
@ -188,7 +188,7 @@ mkPackageOption pkgs "name" { default = [ "path" "in&qu
|
|||
</para>
|
||||
<anchor xml:id="ex-options-declarations-util-mkPackageOption-hello" />
|
||||
<programlisting language="nix">
|
||||
lib.mkPackageOption pkgs "hello" { }
|
||||
lib.mkPackageOptionMD pkgs "hello" { }
|
||||
# is like
|
||||
lib.mkOption {
|
||||
type = lib.types.package;
|
||||
|
@ -199,7 +199,7 @@ lib.mkOption {
|
|||
</programlisting>
|
||||
<anchor xml:id="ex-options-declarations-util-mkPackageOption-ghc" />
|
||||
<programlisting language="nix">
|
||||
lib.mkPackageOption pkgs "GHC" {
|
||||
lib.mkPackageOptionMD pkgs "GHC" {
|
||||
default = [ "ghc" ];
|
||||
example = "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue