Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: remove lib.mdDoc #303841

Merged
merged 4 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ let
scrubOptionValue literalExpression literalExample
showOption showOptionWithDefLocs showFiles
unknownModule mkOption mkPackageOption mkPackageOptionMD
mdDoc literalMD;
literalMD;
inherit (self.types) isType setType defaultTypeMerge defaultFunctor
isOptionType mkOptionType;
inherit (self.asserts)
Expand Down
8 changes: 4 additions & 4 deletions lib/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ let
# TODO: Change the type of this option to a submodule with a
# freeformType, so that individual arguments can be documented
# separately
description = lib.mdDoc ''
description = ''
Additional arguments passed to each module in addition to ones
like `lib`, `config`,
and `pkgs`, `modulesPath`.
Expand Down Expand Up @@ -187,14 +187,14 @@ let
type = types.bool;
internal = true;
default = true;
description = lib.mdDoc "Whether to check whether all option definitions have matching declarations.";
description = "Whether to check whether all option definitions have matching declarations.";
};

_module.freeformType = mkOption {
type = types.nullOr types.optionType;
internal = true;
default = null;
description = lib.mdDoc ''
description = ''
If set, merge all definitions that don't have an associated option
together using this type. The result then gets combined with the
values of all declared options to produce the final `
Expand All @@ -209,7 +209,7 @@ let
_module.specialArgs = mkOption {
readOnly = true;
internal = true;
description = lib.mdDoc ''
description = ''
Externally provided module arguments that can't be modified from
within a configuration, but can be used in module imports.
'';
Expand Down
6 changes: 4 additions & 2 deletions lib/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,11 @@ rec {
literalExample = lib.warn "lib.literalExample is deprecated, use lib.literalExpression instead, or use lib.literalMD for a non-Nix description." literalExpression;

/* Transition marker for documentation that's already migrated to markdown
syntax. This is a no-op and no longer needed.
syntax. Has been a no-op for some while and been removed from nixpkgs.
Kept here to alert downstream users who may not be aware of the migration's
completion that it should be removed from modules.
*/
mdDoc = lib.id;
mdDoc = lib.warn "lib.mdDoc was removed from nixpkgs. Option descriptions are now in Markdown by default, you can remove any remaining uses of it.";

/* For use in the `defaultText` and `example` option attributes. Causes the
given MD text to be inserted verbatim in the documentation, for when
Expand Down
8 changes: 4 additions & 4 deletions nixos/maintainers/scripts/ec2/amazon-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ in {
options.amazonImage = {
name = mkOption {
type = types.str;
description = lib.mdDoc "The name of the generated derivation";
description = "The name of the generated derivation";
default = "nixos-amazon-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
};

Expand All @@ -35,7 +35,7 @@ in {
]
'';
default = [];
description = lib.mdDoc ''
description = ''
This option lists files to be copied to fixed locations in the
generated image. Glob patterns work.
'';
Expand All @@ -45,13 +45,13 @@ in {
type = with types; either (enum [ "auto" ]) int;
default = 3072;
example = 8192;
description = lib.mdDoc "The size in MB of the image";
description = "The size in MB of the image";
};

format = mkOption {
type = types.enum [ "raw" "qcow2" "vpc" ];
default = "vpc";
description = lib.mdDoc "The image format to output";
description = "The image format to output";
};
};

Expand Down
8 changes: 4 additions & 4 deletions nixos/maintainers/scripts/openstack/openstack-image-zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ in
options.openstackImage = {
name = mkOption {
type = types.str;
description = lib.mdDoc "The name of the generated derivation";
description = "The name of the generated derivation";
default = "nixos-openstack-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
};

ramMB = mkOption {
type = types.int;
default = 1024;
description = lib.mdDoc "RAM allocation for build VM";
description = "RAM allocation for build VM";
};

sizeMB = mkOption {
type = types.int;
default = 8192;
description = lib.mdDoc "The size in MB of the image";
description = "The size in MB of the image";
};

format = mkOption {
type = types.enum [ "raw" "qcow2" ];
default = "qcow2";
description = lib.mdDoc "The image format to output";
description = "The image format to output";
};
};

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/appstream.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ with lib;
appstream.enable = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
description = ''
Whether to install files to support the
[AppStream metadata specification](https://www.freedesktop.org/software/appstream/docs/index.html).
'';
Expand Down
14 changes: 7 additions & 7 deletions nixos/modules/config/console.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ in
###### interface

options.console = {
enable = mkEnableOption (lib.mdDoc "virtual console") // {
enable = mkEnableOption "virtual console" // {
default = true;
};

font = mkOption {
type = with types; nullOr (either str path);
default = null;
example = "LatArCyrHeb-16";
description = mdDoc ''
description = ''
The font used for the virtual consoles.
Can be `null`, a font name, or a path to a PSF font file.

Expand All @@ -65,7 +65,7 @@ in
type = with types; either str path;
default = "us";
example = "fr";
description = lib.mdDoc ''
description = ''
The keyboard mapping table for the virtual consoles.
'';
};
Expand All @@ -79,7 +79,7 @@ in
"002b36" "cb4b16" "586e75" "657b83"
"839496" "6c71c4" "93a1a1" "fdf6e3"
];
description = lib.mdDoc ''
description = ''
The 16 colors palette used by the virtual consoles.
Leave empty to use the default colors.
Colors must be in hexadecimal format and listed in
Expand All @@ -91,7 +91,7 @@ in
packages = mkOption {
type = types.listOf types.package;
default = [ ];
description = lib.mdDoc ''
description = ''
List of additional packages that provide console fonts, keymaps and
other resources for virtual consoles use.
'';
Expand All @@ -100,7 +100,7 @@ in
useXkbConfig = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
description = ''
If set, configure the virtual console keymap from the xserver
keyboard settings.
'';
Expand All @@ -109,7 +109,7 @@ in
earlySetup = mkOption {
default = false;
type = types.bool;
description = lib.mdDoc ''
description = ''
Enable setting virtual console options as early as possible (in initrd).
'';
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/debug-info.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ with lib;
environment.enableDebugInfo = mkOption {
type = types.bool;
default = false;
description = mdDoc ''
description = ''
Some NixOS packages provide debug symbols. However, these are
not included in the system closure by default to save disk
space. Enabling this option causes the debug symbols to appear
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/fanout.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
in
{
options.services.fanout = {
enable = lib.mkEnableOption (lib.mdDoc "fanout");
enable = lib.mkEnableOption "fanout";
fanoutDevices = lib.mkOption {
type = lib.types.int;
default = 1;
Expand Down
36 changes: 18 additions & 18 deletions nixos/modules/config/fonts/fontconfig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ in
enable = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
description = ''
If enabled, a Fontconfig configuration file will be built
pointing to a set of default fonts. If you don't care about
running X11 applications or any other program that uses
Expand All @@ -291,15 +291,15 @@ in
internal = true;
type = with types; listOf path;
default = [ ];
description = lib.mdDoc ''
description = ''
Fontconfig configuration packages.
'';
};

antialias = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
description = ''
Enable font antialiasing. At high resolution (> 200 DPI),
antialiasing has no visible effect; users of such displays may want
to disable this option.
Expand All @@ -309,7 +309,7 @@ in
localConf = mkOption {
type = types.lines;
default = "";
description = lib.mdDoc ''
description = ''
System-wide customization file contents, has higher priority than
`defaultFonts` settings.
'';
Expand All @@ -319,7 +319,7 @@ in
monospace = mkOption {
type = types.listOf types.str;
default = ["DejaVu Sans Mono"];
description = lib.mdDoc ''
description = ''
System-wide default monospace font(s). Multiple fonts may be
listed in case multiple languages must be supported.
'';
Expand All @@ -328,7 +328,7 @@ in
sansSerif = mkOption {
type = types.listOf types.str;
default = ["DejaVu Sans"];
description = lib.mdDoc ''
description = ''
System-wide default sans serif font(s). Multiple fonts may be
listed in case multiple languages must be supported.
'';
Expand All @@ -337,7 +337,7 @@ in
serif = mkOption {
type = types.listOf types.str;
default = ["DejaVu Serif"];
description = lib.mdDoc ''
description = ''
System-wide default serif font(s). Multiple fonts may be listed
in case multiple languages must be supported.
'';
Expand All @@ -346,7 +346,7 @@ in
emoji = mkOption {
type = types.listOf types.str;
default = ["Noto Color Emoji"];
description = lib.mdDoc ''
description = ''
System-wide default emoji font(s). Multiple fonts may be listed
in case a font does not support all emoji.

Expand All @@ -363,7 +363,7 @@ in
enable = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
description = ''
Enable font hinting. Hinting aligns glyphs to pixel boundaries to
improve rendering sharpness at low resolution. At high resolution
(> 200 dpi) hinting will do nothing (at best); users of such
Expand All @@ -374,7 +374,7 @@ in
autohint = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
description = ''
Enable the autohinter in place of the default interpreter.
The results are usually lower quality than correctly-hinted
fonts, but better than unhinted fonts.
Expand All @@ -384,7 +384,7 @@ in
style = mkOption {
type = types.enum ["none" "slight" "medium" "full"];
default = "slight";
description = lib.mdDoc ''
description = ''
Hintstyle is the amount of font reshaping done to line up
to the grid.

Expand All @@ -407,7 +407,7 @@ in
includeUserConf = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
description = ''
Include the user configuration from
{file}`~/.config/fontconfig/fonts.conf` or
{file}`~/.config/fontconfig/conf.d`.
Expand All @@ -419,7 +419,7 @@ in
rgba = mkOption {
default = "none";
type = types.enum ["rgb" "bgr" "vrgb" "vbgr" "none"];
description = lib.mdDoc ''
description = ''
Subpixel order. The overwhelming majority of displays are
`rgb` in their normal orientation. Select
`vrgb` for mounting such a display 90 degrees
Expand All @@ -435,7 +435,7 @@ in
lcdfilter = mkOption {
default = "default";
type = types.enum ["none" "default" "light" "legacy"];
description = lib.mdDoc ''
description = ''
FreeType LCD filter. At high resolution (> 200 DPI), LCD filtering
has no visible effect; users of such displays may want to select
`none`.
Expand All @@ -447,15 +447,15 @@ in
cache32Bit = mkOption {
default = false;
type = types.bool;
description = lib.mdDoc ''
description = ''
Generate system fonts cache for 32-bit applications.
'';
};

allowBitmaps = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
description = ''
Allow bitmap fonts. Set to `false` to ban all
bitmap fonts.
'';
Expand All @@ -464,7 +464,7 @@ in
allowType1 = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
description = ''
Allow Type-1 fonts. Default is `false` because of
poor rendering.
'';
Expand All @@ -473,7 +473,7 @@ in
useEmbeddedBitmaps = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Use embedded bitmaps in fonts like Calibri.";
description = "Use embedded bitmaps in fonts like Calibri.";
};

};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/config/fonts/fontdir.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ in
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
description = ''
Whether to create a directory with links to all fonts in
{file}`/run/current-system/sw/share/X11/fonts`.
'';
Expand All @@ -40,7 +40,7 @@ in
type = types.bool;
default = config.programs.xwayland.enable;
defaultText = literalExpression "config.programs.xwayland.enable";
description = lib.mdDoc ''
description = ''
Whether to decompress fonts in
{file}`/run/current-system/sw/share/X11/fonts`.
'';
Expand Down
Loading