summary refs log tree commit diff
path: root/nixos/modules/system/activation/top-level.nix
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2021-10-03 18:06:03 +0200
committerNaïm Favier <n@monade.li>2021-10-04 12:47:20 +0200
commit2ddc335e6f32b875e14ad9610101325b306a0add (patch)
tree2a4591c137cb363a6ec09f529d587a10aa7a0bc7 /nixos/modules/system/activation/top-level.nix
parent330b1e08b8df4e1f0100a0a7810ec3157749e5ee (diff)
downloadnixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.gz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.bz2
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.lz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.xz
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.zst
nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.zip
nixos/doc: clean up defaults and examples
Diffstat (limited to 'nixos/modules/system/activation/top-level.nix')
-rw-r--r--nixos/modules/system/activation/top-level.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index dad9acba91a..026fd1791d3 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -155,7 +155,7 @@ in
 
     specialisation = mkOption {
       default = {};
-      example = lib.literalExample "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";
+      example = lib.literalExpression "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";
       description = ''
         Additional configurations to build. If
         <literal>inheritParentConfig</literal> is true, the system
@@ -243,7 +243,7 @@ in
 
     system.replaceRuntimeDependencies = mkOption {
       default = [];
-      example = lib.literalExample "[ ({ original = pkgs.openssl; replacement = pkgs.callPackage /path/to/openssl { }; }) ]";
+      example = lib.literalExpression "[ ({ original = pkgs.openssl; replacement = pkgs.callPackage /path/to/openssl { }; }) ]";
       type = types.listOf (types.submodule (
         { ... }: {
           options.original = mkOption {
@@ -274,7 +274,11 @@ in
         if config.networking.hostName == ""
         then "unnamed"
         else config.networking.hostName;
-      defaultText = '''networking.hostName' if non empty else "unnamed"'';
+      defaultText = literalExpression ''
+        if config.networking.hostName == ""
+        then "unnamed"
+        else config.networking.hostName;
+      '';
       description = ''
         The name of the system used in the <option>system.build.toplevel</option> derivation.
         </para><para>