summary refs log tree commit diff
path: root/nixos/modules/config
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/config
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/config')
-rw-r--r--nixos/modules/config/fonts/fonts.nix2
-rw-r--r--nixos/modules/config/i18n.nix2
-rw-r--r--nixos/modules/config/krb5/default.nix16
-rw-r--r--nixos/modules/config/networking.nix6
-rw-r--r--nixos/modules/config/power-management.nix4
-rw-r--r--nixos/modules/config/pulseaudio.nix10
-rw-r--r--nixos/modules/config/shells-environment.nix8
-rw-r--r--nixos/modules/config/sysctl.nix2
-rw-r--r--nixos/modules/config/system-path.nix6
-rw-r--r--nixos/modules/config/unix-odbc-drivers.nix2
-rw-r--r--nixos/modules/config/users-groups.nix6
-rw-r--r--nixos/modules/config/xdg/portals/wlr.nix2
12 files changed, 32 insertions, 34 deletions
diff --git a/nixos/modules/config/fonts/fonts.nix b/nixos/modules/config/fonts/fonts.nix
index f87e61e3ef9..04952898cb7 100644
--- a/nixos/modules/config/fonts/fonts.nix
+++ b/nixos/modules/config/fonts/fonts.nix
@@ -61,7 +61,7 @@ in
       fonts = mkOption {
         type = types.listOf types.path;
         default = [];
-        example = literalExample "[ pkgs.dejavu_fonts ]";
+        example = literalExpression "[ pkgs.dejavu_fonts ]";
         description = "List of primary font paths.";
       };
 
diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix
index 991b449d80b..545d4a3dca6 100644
--- a/nixos/modules/config/i18n.nix
+++ b/nixos/modules/config/i18n.nix
@@ -14,7 +14,7 @@ with lib;
           allLocales = any (x: x == "all") config.i18n.supportedLocales;
           locales = config.i18n.supportedLocales;
         };
-        example = literalExample "pkgs.glibcLocales";
+        example = literalExpression "pkgs.glibcLocales";
         description = ''
           Customized pkg.glibcLocales package.
 
diff --git a/nixos/modules/config/krb5/default.nix b/nixos/modules/config/krb5/default.nix
index 6db2a7e4039..911c5b629a9 100644
--- a/nixos/modules/config/krb5/default.nix
+++ b/nixos/modules/config/krb5/default.nix
@@ -83,8 +83,8 @@ in {
       kerberos = mkOption {
         type = types.package;
         default = pkgs.krb5Full;
-        defaultText = "pkgs.krb5Full";
-        example = literalExample "pkgs.heimdal";
+        defaultText = literalExpression "pkgs.krb5Full";
+        example = literalExpression "pkgs.heimdal";
         description = ''
           The Kerberos implementation that will be present in
           <literal>environment.systemPackages</literal> after enabling this
@@ -96,7 +96,7 @@ in {
         type = with types; either attrs lines;
         default = {};
         apply = attrs: filterEmbeddedMetadata attrs;
-        example = literalExample ''
+        example = literalExpression ''
           {
             default_realm = "ATHENA.MIT.EDU";
           };
@@ -109,7 +109,7 @@ in {
       realms = mkOption {
         type = with types; either attrs lines;
         default = {};
-        example = literalExample ''
+        example = literalExpression ''
           {
             "ATHENA.MIT.EDU" = {
               admin_server = "athena.mit.edu";
@@ -127,7 +127,7 @@ in {
       domain_realm = mkOption {
         type = with types; either attrs lines;
         default = {};
-        example = literalExample ''
+        example = literalExpression ''
           {
             "example.com" = "EXAMPLE.COM";
             ".example.com" = "EXAMPLE.COM";
@@ -142,7 +142,7 @@ in {
       capaths = mkOption {
         type = with types; either attrs lines;
         default = {};
-        example = literalExample ''
+        example = literalExpression ''
           {
             "ATHENA.MIT.EDU" = {
               "EXAMPLE.COM" = ".";
@@ -161,7 +161,7 @@ in {
       appdefaults = mkOption {
         type = with types; either attrs lines;
         default = {};
-        example = literalExample ''
+        example = literalExpression ''
           {
             pam = {
               debug = false;
@@ -182,7 +182,7 @@ in {
       plugins = mkOption {
         type = with types; either attrs lines;
         default = {};
-        example = literalExample ''
+        example = literalExpression ''
           {
             ccselect = {
               disable = "k5identity";
diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix
index 8c4eec510e5..11307e33120 100644
--- a/nixos/modules/config/networking.nix
+++ b/nixos/modules/config/networking.nix
@@ -21,7 +21,7 @@ in
 
     networking.hosts = lib.mkOption {
       type = types.attrsOf (types.listOf types.str);
-      example = literalExample ''
+      example = literalExpression ''
         {
           "127.0.0.1" = [ "foo.bar.baz" ];
           "192.168.0.2" = [ "fileserver.local" "nameserver.local" ];
@@ -34,8 +34,8 @@ in
 
     networking.hostFiles = lib.mkOption {
       type = types.listOf types.path;
-      defaultText = lib.literalExample "Hosts from `networking.hosts` and `networking.extraHosts`";
-      example = lib.literalExample ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]'';
+      defaultText = literalDocBook "Hosts from <option>networking.hosts</option> and <option>networking.extraHosts</option>";
+      example = literalExpression ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]'';
       description = ''
         Files that should be concatenated together to form <filename>/etc/hosts</filename>.
       '';
diff --git a/nixos/modules/config/power-management.nix b/nixos/modules/config/power-management.nix
index cc0ff732ffa..710842e1503 100644
--- a/nixos/modules/config/power-management.nix
+++ b/nixos/modules/config/power-management.nix
@@ -35,7 +35,7 @@ in
       powerUpCommands = mkOption {
         type = types.lines;
         default = "";
-        example = literalExample ''
+        example = literalExpression ''
           "''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"
         '';
         description =
@@ -49,7 +49,7 @@ in
       powerDownCommands = mkOption {
         type = types.lines;
         default = "";
-        example = literalExample ''
+        example = literalExpression ''
           "''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"
         '';
         description =
diff --git a/nixos/modules/config/pulseaudio.nix b/nixos/modules/config/pulseaudio.nix
index 3f7ae109e8c..01555d28b73 100644
--- a/nixos/modules/config/pulseaudio.nix
+++ b/nixos/modules/config/pulseaudio.nix
@@ -149,8 +149,8 @@ in {
         default = if config.services.jack.jackd.enable
                   then pkgs.pulseaudioFull
                   else pkgs.pulseaudio;
-        defaultText = "pkgs.pulseaudio";
-        example = literalExample "pkgs.pulseaudioFull";
+        defaultText = literalExpression "pkgs.pulseaudio";
+        example = literalExpression "pkgs.pulseaudioFull";
         description = ''
           The PulseAudio derivation to use.  This can be used to enable
           features (such as JACK support, Bluetooth) via the
@@ -161,7 +161,7 @@ in {
       extraModules = mkOption {
         type = types.listOf types.package;
         default = [];
-        example = literalExample "[ pkgs.pulseaudio-modules-bt ]";
+        example = literalExpression "[ pkgs.pulseaudio-modules-bt ]";
         description = ''
           Extra pulseaudio modules to use. This is intended for out-of-tree
           pulseaudio modules like extra bluetooth codecs.
@@ -184,7 +184,7 @@ in {
           type = types.attrsOf types.unspecified;
           default = {};
           description = "Config of the pulse daemon. See <literal>man pulse-daemon.conf</literal>.";
-          example = literalExample ''{ realtime-scheduling = "yes"; }'';
+          example = literalExpression ''{ realtime-scheduling = "yes"; }'';
         };
       };
 
@@ -204,7 +204,7 @@ in {
           allowedIpRanges = mkOption {
             type = types.listOf types.str;
             default = [];
-            example = literalExample ''[ "127.0.0.1" "192.168.1.0/24" ]'';
+            example = literalExpression ''[ "127.0.0.1" "192.168.1.0/24" ]'';
             description = ''
               A list of IP subnets that are allowed to stream to the server.
             '';
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix
index 34e558d8603..ae3f618e273 100644
--- a/nixos/modules/config/shells-environment.nix
+++ b/nixos/modules/config/shells-environment.nix
@@ -136,10 +136,8 @@ in
 
     environment.binsh = mkOption {
       default = "${config.system.build.binsh}/bin/sh";
-      defaultText = "\${config.system.build.binsh}/bin/sh";
-      example = literalExample ''
-        "''${pkgs.dash}/bin/dash"
-      '';
+      defaultText = literalExpression ''"''${config.system.build.binsh}/bin/sh"'';
+      example = literalExpression ''"''${pkgs.dash}/bin/dash"'';
       type = types.path;
       visible = false;
       description = ''
@@ -152,7 +150,7 @@ in
 
     environment.shells = mkOption {
       default = [];
-      example = literalExample "[ pkgs.bashInteractive pkgs.zsh ]";
+      example = literalExpression "[ pkgs.bashInteractive pkgs.zsh ]";
       description = ''
         A list of permissible login shells for user accounts.
         No need to mention <literal>/bin/sh</literal>
diff --git a/nixos/modules/config/sysctl.nix b/nixos/modules/config/sysctl.nix
index e59c7a32c28..db1f5284f50 100644
--- a/nixos/modules/config/sysctl.nix
+++ b/nixos/modules/config/sysctl.nix
@@ -22,7 +22,7 @@ in
 
     boot.kernel.sysctl = mkOption {
       default = {};
-      example = literalExample ''
+      example = literalExpression ''
         { "net.ipv4.tcp_syncookies" = false; "vm.swappiness" = 60; }
       '';
       type = types.attrsOf sysctlOption;
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix
index 1292c3008c6..6ff4ec2921c 100644
--- a/nixos/modules/config/system-path.nix
+++ b/nixos/modules/config/system-path.nix
@@ -58,7 +58,7 @@ in
       systemPackages = mkOption {
         type = types.listOf types.package;
         default = [];
-        example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
+        example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
         description = ''
           The set of packages that appear in
           /run/current-system/sw.  These packages are
@@ -73,9 +73,9 @@ in
       defaultPackages = mkOption {
         type = types.listOf types.package;
         default = defaultPackages;
-        example = literalExample "[]";
+        example = [];
         description = ''
-          Set of default packages that aren't strictly neccessary
+          Set of default packages that aren't strictly necessary
           for a running system, entries can be removed for a more
           minimal NixOS installation.
 
diff --git a/nixos/modules/config/unix-odbc-drivers.nix b/nixos/modules/config/unix-odbc-drivers.nix
index abc12a627d6..055c3b2364e 100644
--- a/nixos/modules/config/unix-odbc-drivers.nix
+++ b/nixos/modules/config/unix-odbc-drivers.nix
@@ -19,7 +19,7 @@ in {
     environment.unixODBCDrivers = mkOption {
       type = types.listOf types.package;
       default = [];
-      example = literalExample "with pkgs.unixODBCDrivers; [ sqlite psql ]";
+      example = literalExpression "with pkgs.unixODBCDrivers; [ sqlite psql ]";
       description = ''
         Specifies Unix ODBC drivers to be registered in
         <filename>/etc/odbcinst.ini</filename>.  You may also want to
diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix
index 8e2db9107a1..629905e6095 100644
--- a/nixos/modules/config/users-groups.nix
+++ b/nixos/modules/config/users-groups.nix
@@ -165,8 +165,8 @@ let
       shell = mkOption {
         type = types.nullOr (types.either types.shellPackage (passwdEntry types.path));
         default = pkgs.shadow;
-        defaultText = "pkgs.shadow";
-        example = literalExample "pkgs.bashInteractive";
+        defaultText = literalExpression "pkgs.shadow";
+        example = literalExpression "pkgs.bashInteractive";
         description = ''
           The path to the user's shell. Can use shell derivations,
           like <literal>pkgs.bashInteractive</literal>. Don’t
@@ -291,7 +291,7 @@ let
       packages = mkOption {
         type = types.listOf types.package;
         default = [];
-        example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
+        example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
         description = ''
           The set of packages that should be made available to the user.
           This is in contrast to <option>environment.systemPackages</option>,
diff --git a/nixos/modules/config/xdg/portals/wlr.nix b/nixos/modules/config/xdg/portals/wlr.nix
index 55baab0026b..aba1d8dbc00 100644
--- a/nixos/modules/config/xdg/portals/wlr.nix
+++ b/nixos/modules/config/xdg/portals/wlr.nix
@@ -37,7 +37,7 @@ in
       default = { };
 
       # Example taken from the manpage
-      example = literalExample ''
+      example = literalExpression ''
         {
           screencast = {
             output_name = "HDMI-A-1";