From 2ddc335e6f32b875e14ad9610101325b306a0add Mon Sep 17 00:00:00 2001 From: Naïm Favier Date: Sun, 3 Oct 2021 18:06:03 +0200 Subject: nixos/doc: clean up defaults and examples --- nixos/modules/misc/documentation.nix | 4 ++-- nixos/modules/misc/locate.nix | 4 ++-- nixos/modules/misc/nixpkgs.nix | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'nixos/modules/misc') diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index ec6b2ad3b8816..c3ded4f1ea340 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -133,7 +133,7 @@ in extraOutputsToInstall = ["man"]; ignoreCollisions = true; }; - defaultText = "all man pages in config.environment.systemPackages"; + defaultText = literalDocBook "all man pages in "; description = '' The manual pages to generate caches for if is enabled. Must be a path to a directory with man pages under @@ -211,7 +211,7 @@ in Which extra NixOS module paths the generated NixOS's documentation should strip from options. ''; - example = literalExample '' + example = literalExpression '' # e.g. with options from modules in ''${pkgs.customModules}/nix: [ pkgs.customModules ] ''; diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix index 5d2f9a21bc524..2f2986c2fec5a 100644 --- a/nixos/modules/misc/locate.nix +++ b/nixos/modules/misc/locate.nix @@ -25,8 +25,8 @@ in { locate = mkOption { type = package; default = pkgs.findutils; - defaultText = "pkgs.findutils"; - example = "pkgs.mlocate"; + defaultText = literalExpression "pkgs.findutils"; + example = literalExpression "pkgs.mlocate"; description = '' The locate implementation to use ''; diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index a2ac5c58528af..08bc4398555b7 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -67,13 +67,13 @@ in options.nixpkgs = { pkgs = mkOption { - defaultText = literalExample - ''import "''${nixos}/.." { - inherit (cfg) config overlays localSystem crossSystem; - } - ''; + defaultText = literalExpression '' + import "''${nixos}/.." { + inherit (cfg) config overlays localSystem crossSystem; + } + ''; type = pkgsType; - example = literalExample "import {}"; + example = literalExpression "import {}"; description = '' If set, the pkgs argument to all NixOS modules is the value of this option, extended with nixpkgs.overlays, if @@ -109,7 +109,7 @@ in config = mkOption { default = {}; - example = literalExample + example = literalExpression '' { allowBroken = true; allowUnfree = true; } ''; @@ -125,7 +125,7 @@ in overlays = mkOption { default = []; - example = literalExample + example = literalExpression '' [ (self: super: { @@ -158,7 +158,7 @@ in # Make sure that the final value has all fields for sake of other modules # referring to this. TODO make `lib.systems` itself use the module system. apply = lib.systems.elaborate; - defaultText = literalExample + defaultText = literalExpression ''(import "''${nixos}/../lib").lib.systems.examples.aarch64-multiplatform''; description = '' Specifies the platform on which NixOS should be built. When -- cgit 1.4.1