···54545555 Example:
5656 mkOption { } // => { _type = "option"; }
5757- mkOption { defaultText = "foo"; } // => { _type = "option"; defaultText = "foo"; }
5757+ mkOption { default = "foo"; } // => { _type = "option"; default = "foo"; }
5858 */
5959 mkOption =
6060 {
···212212 else x;
213213214214215215- /* For use in the `example` option attribute. It causes the given
216216- text to be included verbatim in documentation. This is necessary
217217- for example values that are not simple values, e.g., functions.
215215+ /* For use in the `defaultText` and `example` option attributes. Causes the
216216+ given string to be rendered verbatim in the documentation as Nix code. This
217217+ is necessary for complex values, e.g. functions, or values that depend on
218218+ other values or packages.
218219 */
219219- literalExample = text: { _type = "literalExample"; inherit text; };
220220+ literalExpression = text:
221221+ if ! isString text then throw "literalExpression expects a string."
222222+ else { _type = "literalExpression"; inherit text; };
223223+224224+ literalExample = lib.warn "literalExample is deprecated, use literalExpression instead, or use literalDocBook for a non-Nix description." literalExpression;
225225+226226+227227+ /* For use in the `defaultText` and `example` option attributes. Causes the
228228+ given DocBook text to be inserted verbatim in the documentation, for when
229229+ a `literalExpression` would be too hard to read.
230230+ */
231231+ literalDocBook = text:
232232+ if ! isString text then throw "literalDocBook expects a string."
233233+ else { _type = "literalDocBook"; inherit text; };
220234221235 # Helper functions.
222236
···3838 of the module will have to define the value of the option, otherwise
3939 an error will be thrown.
40404141+`defaultText`
4242+4343+: A textual representation of the default value to be rendered verbatim in
4444+ the manual. Useful if the default value is a complex expression or depends
4545+ on other values or packages.
4646+ Use `lib.literalExpression` for a Nix expression, `lib.literalDocBook` for
4747+ a plain English description in DocBook format.
4848+4149`example`
42504351: An example value that will be shown in the NixOS manual.
5252+ You can use `lib.literalExpression` and `lib.literalDocBook` in the same way
5353+ as in `defaultText`.
44544555`description`
4656
···5959 </varlistentry>
6060 <varlistentry>
6161 <term>
6262+ <literal>defaultText</literal>
6363+ </term>
6464+ <listitem>
6565+ <para>
6666+ A textual representation of the default value to be rendered
6767+ verbatim in the manual. Useful if the default value is a
6868+ complex expression or depends on other values or packages. Use
6969+ <literal>lib.literalExpression</literal> for a Nix expression,
7070+ <literal>lib.literalDocBook</literal> for a plain English
7171+ description in DocBook format.
7272+ </para>
7373+ </listitem>
7474+ </varlistentry>
7575+ <varlistentry>
7676+ <term>
6277 <literal>example</literal>
6378 </term>
6479 <listitem>
6580 <para>
6666- An example value that will be shown in the NixOS manual.
8181+ An example value that will be shown in the NixOS manual. You
8282+ can use <literal>lib.literalExpression</literal> and
8383+ <literal>lib.literalDocBook</literal> in the same way as in
8484+ <literal>defaultText</literal>.
6785 </para>
6886 </listitem>
6987 </varlistentry>
···149149 default = if config.services.jack.jackd.enable
150150 then pkgs.pulseaudioFull
151151 else pkgs.pulseaudio;
152152- defaultText = "pkgs.pulseaudio";
153153- example = literalExample "pkgs.pulseaudioFull";
152152+ defaultText = literalExpression "pkgs.pulseaudio";
153153+ example = literalExpression "pkgs.pulseaudioFull";
154154 description = ''
155155 The PulseAudio derivation to use. This can be used to enable
156156 features (such as JACK support, Bluetooth) via the
···161161 extraModules = mkOption {
162162 type = types.listOf types.package;
163163 default = [];
164164- example = literalExample "[ pkgs.pulseaudio-modules-bt ]";
164164+ example = literalExpression "[ pkgs.pulseaudio-modules-bt ]";
165165 description = ''
166166 Extra pulseaudio modules to use. This is intended for out-of-tree
167167 pulseaudio modules like extra bluetooth codecs.
···184184 type = types.attrsOf types.unspecified;
185185 default = {};
186186 description = "Config of the pulse daemon. See <literal>man pulse-daemon.conf</literal>.";
187187- example = literalExample ''{ realtime-scheduling = "yes"; }'';
187187+ example = literalExpression ''{ realtime-scheduling = "yes"; }'';
188188 };
189189 };
190190···204204 allowedIpRanges = mkOption {
205205 type = types.listOf types.str;
206206 default = [];
207207- example = literalExample ''[ "127.0.0.1" "192.168.1.0/24" ]'';
207207+ example = literalExpression ''[ "127.0.0.1" "192.168.1.0/24" ]'';
208208 description = ''
209209 A list of IP subnets that are allowed to stream to the server.
210210 '';
+3-5
nixos/modules/config/shells-environment.nix
···136136137137 environment.binsh = mkOption {
138138 default = "${config.system.build.binsh}/bin/sh";
139139- defaultText = "\${config.system.build.binsh}/bin/sh";
140140- example = literalExample ''
141141- "''${pkgs.dash}/bin/dash"
142142- '';
139139+ defaultText = literalExpression ''"''${config.system.build.binsh}/bin/sh"'';
140140+ example = literalExpression ''"''${pkgs.dash}/bin/dash"'';
143141 type = types.path;
144142 visible = false;
145143 description = ''
···152150153151 environment.shells = mkOption {
154152 default = [];
155155- example = literalExample "[ pkgs.bashInteractive pkgs.zsh ]";
153153+ example = literalExpression "[ pkgs.bashInteractive pkgs.zsh ]";
156154 description = ''
157155 A list of permissible login shells for user accounts.
158156 No need to mention <literal>/bin/sh</literal>
···5858 systemPackages = mkOption {
5959 type = types.listOf types.package;
6060 default = [];
6161- example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
6161+ example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
6262 description = ''
6363 The set of packages that appear in
6464 /run/current-system/sw. These packages are
···7373 defaultPackages = mkOption {
7474 type = types.listOf types.package;
7575 default = defaultPackages;
7676- example = literalExample "[]";
7676+ example = [];
7777 description = ''
7878- Set of default packages that aren't strictly neccessary
7878+ Set of default packages that aren't strictly necessary
7979 for a running system, entries can be removed for a more
8080 minimal NixOS installation.
8181
+1-1
nixos/modules/config/unix-odbc-drivers.nix
···1919 environment.unixODBCDrivers = mkOption {
2020 type = types.listOf types.package;
2121 default = [];
2222- example = literalExample "with pkgs.unixODBCDrivers; [ sqlite psql ]";
2222+ example = literalExpression "with pkgs.unixODBCDrivers; [ sqlite psql ]";
2323 description = ''
2424 Specifies Unix ODBC drivers to be registered in
2525 <filename>/etc/odbcinst.ini</filename>. You may also want to
+3-3
nixos/modules/config/users-groups.nix
···165165 shell = mkOption {
166166 type = types.nullOr (types.either types.shellPackage (passwdEntry types.path));
167167 default = pkgs.shadow;
168168- defaultText = "pkgs.shadow";
169169- example = literalExample "pkgs.bashInteractive";
168168+ defaultText = literalExpression "pkgs.shadow";
169169+ example = literalExpression "pkgs.bashInteractive";
170170 description = ''
171171 The path to the user's shell. Can use shell derivations,
172172 like <literal>pkgs.bashInteractive</literal>. Don’t
···291291 packages = mkOption {
292292 type = types.listOf types.package;
293293 default = [];
294294- example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
294294+ example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
295295 description = ''
296296 The set of packages that should be made available to the user.
297297 This is in contrast to <option>environment.systemPackages</option>,
+1-1
nixos/modules/config/xdg/portals/wlr.nix
···3737 default = { };
38383939 # Example taken from the manpage
4040- example = literalExample ''
4040+ example = literalExpression ''
4141 {
4242 screencast = {
4343 output_name = "HDMI-A-1";
···2121 each .dtb file matching "compatible" of the overlay.
2222 '';
2323 default = null;
2424- example = literalExample "./dts/overlays.dts";
2424+ example = literalExpression "./dts/overlays.dts";
2525 };
26262727 dtsText = mkOption {
···3131 Literal DTS contents, overlay is applied to
3232 each .dtb file matching "compatible" of the overlay.
3333 '';
3434- example = literalExample ''
3434+ example = ''
3535 /dts-v1/;
3636 /plugin/;
3737 / {
···125125126126 kernelPackage = mkOption {
127127 default = config.boot.kernelPackages.kernel;
128128- defaultText = "config.boot.kernelPackages.kernel";
129129- example = literalExample "pkgs.linux_latest";
128128+ defaultText = literalExpression "config.boot.kernelPackages.kernel";
129129+ example = literalExpression "pkgs.linux_latest";
130130 type = types.path;
131131 description = ''
132132 Kernel package containing the base device-tree (.dtb) to boot. Uses
···156156157157 overlays = mkOption {
158158 default = [];
159159- example = literalExample ''
159159+ example = literalExpression ''
160160 [
161161 { name = "pps"; dtsFile = ./dts/pps.dts; }
162162 { name = "spi";
+1-1
nixos/modules/hardware/digitalbitbox.nix
···1919 package = mkOption {
2020 type = types.package;
2121 default = pkgs.digitalbitbox;
2222- defaultText = "pkgs.digitalbitbox";
2222+ defaultText = literalExpression "pkgs.digitalbitbox";
2323 description = "The Digital Bitbox package to use. This can be used to install a package with udev rules that differ from the defaults.";
2424 };
2525 };
+2-2
nixos/modules/hardware/opengl.nix
···8989 extraPackages = mkOption {
9090 type = types.listOf types.package;
9191 default = [];
9292- example = literalExample "with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau intel-ocl ]";
9292+ example = literalExpression "with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau intel-ocl ]";
9393 description = ''
9494 Additional packages to add to OpenGL drivers. This can be used
9595 to add OpenCL drivers, VA-API/VDPAU drivers etc.
···9999 extraPackages32 = mkOption {
100100 type = types.listOf types.package;
101101 default = [];
102102- example = literalExample "with pkgs.pkgsi686Linux; [ vaapiIntel libvdpau-va-gl vaapiVdpau ]";
102102+ example = literalExpression "with pkgs.pkgsi686Linux; [ vaapiIntel libvdpau-va-gl vaapiVdpau ]";
103103 description = ''
104104 Additional packages to add to 32-bit OpenGL drivers on
105105 64-bit systems. Used when <option>driSupport32Bit</option> is
···7272 };
7373 deviceUri = mkOption {
7474 type = types.str;
7575- example = [
7575+ example = literalExpression ''
7676 "ipp://printserver.local/printers/BrotherHL_Workroom"
7777 "usb://HP/DESKJET%20940C?serial=CN16E6C364BH"
7878- ];
7878+ '';
7979 description = ''
8080 How to reach the printer.
8181 <command>lpinfo -v</command> shows a list of supported device URIs and schemes.
···8383 };
8484 model = mkOption {
8585 type = types.str;
8686- example = literalExample ''
8787- gutenprint.''${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}://brother-hl-5140/expert
8686+ example = literalExpression ''
8787+ "gutenprint.''${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}://brother-hl-5140/expert"
8888 '';
8989 description = ''
9090 Location of the ppd driver file for the printer.
+1-1
nixos/modules/hardware/sata.nix
···3939 enable = mkEnableOption "SATA drive timeouts";
40404141 deciSeconds = mkOption {
4242- example = "70";
4242+ example = 70;
4343 type = types.int;
4444 description = ''
4545 Set SCT Error Recovery Control timeout in deciseconds for use in RAID configurations.
+2-2
nixos/modules/hardware/video/nvidia.nix
···165165 hardware.nvidia.package = lib.mkOption {
166166 type = lib.types.package;
167167 default = config.boot.kernelPackages.nvidiaPackages.stable;
168168- defaultText = "config.boot.kernelPackages.nvidiaPackages.stable";
168168+ defaultText = literalExpression "config.boot.kernelPackages.nvidiaPackages.stable";
169169 description = ''
170170 The NVIDIA X11 derivation to use.
171171 '';
172172- example = "config.boot.kernelPackages.nvidiaPackages.legacy_340";
172172+ example = literalExpression "config.boot.kernelPackages.nvidiaPackages.legacy_340";
173173 };
174174 };
175175
+1-1
nixos/modules/hardware/video/uvcvideo/default.nix
···33333434 packages = mkOption {
3535 type = types.listOf types.path;
3636- example = literalExample "[ pkgs.tiscamera ]";
3636+ example = literalExpression "[ pkgs.tiscamera ]";
3737 description = ''
3838 List of packages containing <command>uvcvideo</command> dynamic controls
3939 rules. All files found in
+1-1
nixos/modules/i18n/input-method/fcitx.nix
···1717 engines = mkOption {
1818 type = with types; listOf fcitxEngine;
1919 default = [];
2020- example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
2020+ example = literalExpression "with pkgs.fcitx-engines; [ mozc hangul ]";
2121 description =
2222 let
2323 enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;
+1-1
nixos/modules/i18n/input-method/fcitx5.nix
···1212 addons = mkOption {
1313 type = with types; listOf package;
1414 default = [];
1515- example = with pkgs; [ fcitx5-rime ];
1515+ example = literalExpression "with pkgs; [ fcitx5-rime ]";
1616 description = ''
1717 Enabled Fcitx5 addons.
1818 '';
+2-2
nixos/modules/i18n/input-method/ibus.nix
···3636 engines = mkOption {
3737 type = with types; listOf ibusEngine;
3838 default = [];
3939- example = literalExample "with pkgs.ibus-engines; [ mozc hangul ]";
3939+ example = literalExpression "with pkgs.ibus-engines; [ mozc hangul ]";
4040 description =
4141 let
4242 enginesDrv = filterAttrs (const isDerivation) pkgs.ibus-engines;
···4848 panel = mkOption {
4949 type = with types; nullOr path;
5050 default = null;
5151- example = literalExample "''${pkgs.plasma5Packages.plasma-desktop}/lib/libexec/kimpanel-ibus-panel";
5151+ example = literalExpression ''"''${pkgs.plasma5Packages.plasma-desktop}/lib/libexec/kimpanel-ibus-panel"'';
5252 description = "Replace the IBus panel with another panel.";
5353 };
5454 };
···528528 };
529529530530 isoImage.contents = mkOption {
531531- example = literalExample ''
531531+ example = literalExpression ''
532532 [ { source = pkgs.memtest86 + "/memtest.bin";
533533 target = "boot/memtest.bin";
534534 }
···541541 };
542542543543 isoImage.storeContents = mkOption {
544544- example = literalExample "[ pkgs.stdenv ]";
544544+ example = literalExpression "[ pkgs.stdenv ]";
545545 description = ''
546546 This option lists additional derivations to be included in the
547547 Nix store in the generated ISO image.
+2-2
nixos/modules/installer/cd-dvd/system-tarball.nix
···1515{
1616 options = {
1717 tarball.contents = mkOption {
1818- example = literalExample ''
1818+ example = literalExpression ''
1919 [ { source = pkgs.memtest86 + "/memtest.bin";
2020 target = "boot/memtest.bin";
2121 }
···2828 };
29293030 tarball.storeContents = mkOption {
3131- example = literalExample "[ pkgs.stdenv ]";
3131+ example = literalExpression "[ pkgs.stdenv ]";
3232 description = ''
3333 This option lists additional derivations to be included in the
3434 Nix store in the generated ISO image.
+1-1
nixos/modules/installer/netboot/netboot.nix
···99 options = {
10101111 netboot.storeContents = mkOption {
1212- example = literalExample "[ pkgs.stdenv ]";
1212+ example = literalExpression "[ pkgs.stdenv ]";
1313 description = ''
1414 This option lists additional derivations to be included in the
1515 Nix store in the generated netboot image.
+4-4
nixos/modules/installer/sd-card/sd-image.nix
···49495050 storePaths = mkOption {
5151 type = with types; listOf package;
5252- example = literalExample "[ pkgs.stdenv ]";
5252+ example = literalExpression "[ pkgs.stdenv ]";
5353 description = ''
5454 Derivations to be included in the Nix store in the generated SD image.
5555 '';
···107107 };
108108109109 populateFirmwareCommands = mkOption {
110110- example = literalExample "'' cp \${pkgs.myBootLoader}/u-boot.bin firmware/ ''";
110110+ example = literalExpression "'' cp \${pkgs.myBootLoader}/u-boot.bin firmware/ ''";
111111 description = ''
112112 Shell commands to populate the ./firmware directory.
113113 All files in that directory are copied to the
···116116 };
117117118118 populateRootCommands = mkOption {
119119- example = literalExample "''\${config.boot.loader.generic-extlinux-compatible.populateCmd} -c \${config.system.build.toplevel} -d ./files/boot''";
119119+ example = literalExpression "''\${config.boot.loader.generic-extlinux-compatible.populateCmd} -c \${config.system.build.toplevel} -d ./files/boot''";
120120 description = ''
121121 Shell commands to populate the ./files directory.
122122 All files in that directory are copied to the
···126126 };
127127128128 postBuildCommands = mkOption {
129129- example = literalExample "'' dd if=\${pkgs.myBootLoader}/SPL of=$img bs=1024 seek=1 conv=notrunc ''";
129129+ example = literalExpression "'' dd if=\${pkgs.myBootLoader}/SPL of=$img bs=1024 seek=1 conv=notrunc ''";
130130 default = "";
131131 description = ''
132132 Shell commands to run after the image is built.
+2-2
nixos/modules/misc/documentation.nix
···133133 extraOutputsToInstall = ["man"];
134134 ignoreCollisions = true;
135135 };
136136- defaultText = "all man pages in config.environment.systemPackages";
136136+ defaultText = literalDocBook "all man pages in <option>config.environment.systemPackages</option>";
137137 description = ''
138138 The manual pages to generate caches for if <option>generateCaches</option>
139139 is enabled. Must be a path to a directory with man pages under
···211211 Which extra NixOS module paths the generated NixOS's documentation should strip
212212 from options.
213213 '';
214214- example = literalExample ''
214214+ example = literalExpression ''
215215 # e.g. with options from modules in ''${pkgs.customModules}/nix:
216216 [ pkgs.customModules ]
217217 '';
+2-2
nixos/modules/misc/locate.nix
···2525 locate = mkOption {
2626 type = package;
2727 default = pkgs.findutils;
2828- defaultText = "pkgs.findutils";
2929- example = "pkgs.mlocate";
2828+ defaultText = literalExpression "pkgs.findutils";
2929+ example = literalExpression "pkgs.mlocate";
3030 description = ''
3131 The locate implementation to use
3232 '';
+9-9
nixos/modules/misc/nixpkgs.nix
···6767 options.nixpkgs = {
68686969 pkgs = mkOption {
7070- defaultText = literalExample
7171- ''import "''${nixos}/.." {
7272- inherit (cfg) config overlays localSystem crossSystem;
7373- }
7474- '';
7070+ defaultText = literalExpression ''
7171+ import "''${nixos}/.." {
7272+ inherit (cfg) config overlays localSystem crossSystem;
7373+ }
7474+ '';
7575 type = pkgsType;
7676- example = literalExample "import <nixpkgs> {}";
7676+ example = literalExpression "import <nixpkgs> {}";
7777 description = ''
7878 If set, the pkgs argument to all NixOS modules is the value of
7979 this option, extended with <code>nixpkgs.overlays</code>, if
···109109110110 config = mkOption {
111111 default = {};
112112- example = literalExample
112112+ example = literalExpression
113113 ''
114114 { allowBroken = true; allowUnfree = true; }
115115 '';
···125125126126 overlays = mkOption {
127127 default = [];
128128- example = literalExample
128128+ example = literalExpression
129129 ''
130130 [
131131 (self: super: {
···158158 # Make sure that the final value has all fields for sake of other modules
159159 # referring to this. TODO make `lib.systems` itself use the module system.
160160 apply = lib.systems.elaborate;
161161- defaultText = literalExample
161161+ defaultText = literalExpression
162162 ''(import "''${nixos}/../lib").lib.systems.examples.aarch64-multiplatform'';
163163 description = ''
164164 Specifies the platform on which NixOS should be built. When
+2-2
nixos/modules/programs/atop.nix
···1919 package = mkOption {
2020 type = types.package;
2121 default = pkgs.atop;
2222- defaultText = "pkgs.atop";
2222+ defaultText = literalExpression "pkgs.atop";
2323 description = ''
2424 Which package to use for Atop.
2525 '';
···3737 package = mkOption {
3838 type = types.package;
3939 default = config.boot.kernelPackages.netatop;
4040- defaultText = "config.boot.kernelPackages.netatop";
4040+ defaultText = literalExpression "config.boot.kernelPackages.netatop";
4141 description = ''
4242 Which package to use for netatop.
4343 '';
+1-1
nixos/modules/programs/captive-browser.nix
···1414 package = mkOption {
1515 type = types.package;
1616 default = pkgs.captive-browser;
1717- defaultText = "pkgs.captive-browser";
1717+ defaultText = literalExpression "pkgs.captive-browser";
1818 description = "Which package to use for captive-browser";
1919 };
2020
+2-2
nixos/modules/programs/chromium.nix
···3333 for additional details.
3434 '';
3535 default = [];
3636- example = literalExample ''
3636+ example = literalExpression ''
3737 [
3838 "chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
3939 "mbniclmhobmnbdlbpiphghaielnnpgdp" # lightshot
···7575 Make sure the selected policy is supported on Linux and your browser version.
7676 '';
7777 default = {};
7878- example = literalExample ''
7878+ example = literalExpression ''
7979 {
8080 "BrowserSignin" = 0;
8181 "SyncDisabled" = true;
+1-1
nixos/modules/programs/digitalbitbox/default.nix
···1919 package = mkOption {
2020 type = types.package;
2121 default = pkgs.digitalbitbox;
2222- defaultText = "pkgs.digitalbitbox";
2222+ defaultText = literalExpression "pkgs.digitalbitbox";
2323 description = "The Digital Bitbox package to use. This can be used to install a package with udev rules that differ from the defaults.";
2424 };
2525 };
···1717 environment.freetds = mkOption {
1818 type = types.attrsOf types.str;
1919 default = {};
2020- example = literalExample ''
2020+ example = literalExpression ''
2121 { MYDATABASE = '''
2222 host = 10.0.2.100
2323 port = 1433
+1-1
nixos/modules/programs/gamemode.nix
···2323 System-wide configuration for GameMode (/etc/gamemode.ini).
2424 See gamemoded(8) man page for available settings.
2525 '';
2626- example = literalExample ''
2626+ example = literalExpression ''
2727 {
2828 general = {
2929 renice = 10;
+2-2
nixos/modules/programs/git.nix
···1414 package = mkOption {
1515 type = types.package;
1616 default = pkgs.git;
1717- defaultText = "pkgs.git";
1818- example = literalExample "pkgs.gitFull";
1717+ defaultText = literalExpression "pkgs.git";
1818+ example = literalExpression "pkgs.gitFull";
1919 description = "The git package to use";
2020 };
2121
+1-1
nixos/modules/programs/gnupg.nix
···2727 package = mkOption {
2828 type = types.package;
2929 default = pkgs.gnupg;
3030- defaultText = "pkgs.gnupg";
3030+ defaultText = literalExpression "pkgs.gnupg";
3131 description = ''
3232 The gpg package that should be used.
3333 '';
···1313 '';
1414 package = mkOption {
1515 default = pkgs.kdeconnect;
1616- defaultText = "pkgs.kdeconnect";
1616+ defaultText = literalExpression "pkgs.kdeconnect";
1717 type = types.package;
1818- example = literalExample "pkgs.gnomeExtensions.gsconnect";
1818+ example = literalExpression "pkgs.gnomeExtensions.gsconnect";
1919 description = ''
2020 The package providing the implementation for kdeconnect.
2121 '';
+2-1
nixos/modules/programs/less.nix
···4040 configFile = mkOption {
4141 type = types.nullOr types.path;
4242 default = null;
4343- example = literalExample "\${pkgs.my-configs}/lesskey";
4343+ example = literalExpression ''"''${pkgs.my-configs}/lesskey"'';
4444 description = ''
4545 Path to lesskey configuration file.
4646···9191 lessopen = mkOption {
9292 type = types.nullOr types.str;
9393 default = "|${pkgs.lesspipe}/bin/lesspipe.sh %s";
9494+ defaultText = literalExpression ''"|''${pkgs.lesspipe}/bin/lesspipe.sh %s"'';
9495 description = ''
9596 Before less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are displayed.
9697 '';
+1
nixos/modules/programs/mtr.nix
···2020 package = mkOption {
2121 type = types.package;
2222 default = pkgs.mtr;
2323+ defaultText = literalExpression "pkgs.mtr";
2324 description = ''
2425 The package to use.
2526 '';
+13-13
nixos/modules/programs/neovim.nix
···4747 configure = mkOption {
4848 type = types.attrs;
4949 default = {};
5050- example = literalExample ''
5151- configure = {
5252- customRC = $''''
5050+ example = literalExpression ''
5151+ {
5252+ customRC = '''
5353 " here your custom configuration goes!
5454- $'''';
5555- packages.myVimPackage = with pkgs.vimPlugins; {
5656- # loaded on launch
5757- start = [ fugitive ];
5858- # manually loadable by calling `:packadd $plugin-name`
5959- opt = [ ];
6060- };
5454+ ''';
5555+ packages.myVimPackage = with pkgs.vimPlugins; {
5656+ # loaded on launch
5757+ start = [ fugitive ];
5858+ # manually loadable by calling `:packadd $plugin-name`
5959+ opt = [ ];
6160 };
6161+ }
6262 '';
6363 description = ''
6464 Generate your init file from your list of plugins and custom commands.
···6969 package = mkOption {
7070 type = types.package;
7171 default = pkgs.neovim-unwrapped;
7272- defaultText = literalExample "pkgs.neovim-unwrapped";
7272+ defaultText = literalExpression "pkgs.neovim-unwrapped";
7373 description = "The package to use for the neovim binary.";
7474 };
7575···82828383 runtime = mkOption {
8484 default = {};
8585- example = literalExample ''
8686- runtime."ftplugin/c.vim".text = "setlocal omnifunc=v:lua.vim.lsp.omnifunc";
8585+ example = literalExpression ''
8686+ { "ftplugin/c.vim".text = "setlocal omnifunc=v:lua.vim.lsp.omnifunc"; }
8787 '';
8888 description = ''
8989 Set of files that have to be linked in <filename>runtime</filename>.
+1
nixos/modules/programs/noisetorch.nix
···1010 package = mkOption {
1111 type = types.package;
1212 default = pkgs.noisetorch;
1313+ defaultText = literalExpression "pkgs.noisetorch";
1314 description = ''
1415 The noisetorch package to use.
1516 '';
+3-2
nixos/modules/programs/npm.nix
···1414 enable = mkEnableOption "<command>npm</command> global config";
15151616 package = mkOption {
1717- type = types.path;
1717+ type = types.package;
1818 description = "The npm package version / flavor to use";
1919 default = pkgs.nodePackages.npm;
2020- example = literalExample "pkgs.nodePackages_13_x.npm";
2020+ defaultText = literalExpression "pkgs.nodePackages.npm";
2121+ example = literalExpression "pkgs.nodePackages_13_x.npm";
2122 };
22232324 npmrc = mkOption {
+1-1
nixos/modules/programs/proxychains.nix
···120120 Proxies to be used by proxychains.
121121 '';
122122123123- example = literalExample ''
123123+ example = literalExpression ''
124124 { myproxy =
125125 { type = "socks4";
126126 host = "127.0.0.1";
+1-1
nixos/modules/programs/shadow.nix
···6666 This must not be a store path, since the path is
6767 used outside the store (in particular in /etc/passwd).
6868 '';
6969- example = literalExample "pkgs.zsh";
6969+ example = literalExpression "pkgs.zsh";
7070 type = types.either types.path types.shellPackage;
7171 };
7272
···4242 default = {};
4343 type = types.attrsOf types.str;
44444545- example = literalExample ''
4545+ example = literalExpression ''
4646 {
4747 "rm -rf *" = "fg=white,bold,bg=red";
4848 }
···5959 default = {};
6060 type = types.attrsOf types.str;
61616262- example = literalExample ''
6262+ example = literalExpression ''
6363 {
6464 "alias" = "fg=magenta,bold";
6565 }
+2-2
nixos/modules/security/acme.nix
···486486 extraDomainNames = mkOption {
487487 type = types.listOf types.str;
488488 default = [];
489489- example = literalExample ''
489489+ example = literalExpression ''
490490 [
491491 "example.org"
492492 "mydomain.org"
···656656 to those units if they rely on the certificates being present,
657657 or trigger restarts of the service if certificates get renewed.
658658 '';
659659- example = literalExample ''
659659+ example = literalExpression ''
660660 {
661661 "example.com" = {
662662 webroot = "/var/lib/acme/acme-challenge/";
+2-2
nixos/modules/security/ca.nix
···2424 security.pki.certificateFiles = mkOption {
2525 type = types.listOf types.path;
2626 default = [];
2727- example = literalExample "[ \"\${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt\" ]";
2727+ example = literalExpression ''[ "''${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]'';
2828 description = ''
2929 A list of files containing trusted root certificates in PEM
3030 format. These are concatenated to form
···3737 security.pki.certificates = mkOption {
3838 type = types.listOf types.str;
3939 default = [];
4040- example = literalExample ''
4040+ example = literalExpression ''
4141 [ '''
4242 NixOS.org
4343 =========
+1-1
nixos/modules/security/dhparams.nix
···5353 coerce = bits: { inherit bits; };
5454 in attrsOf (coercedTo int coerce (submodule paramsSubmodule));
5555 default = {};
5656- example = lib.literalExample "{ nginx.bits = 3072; }";
5656+ example = lib.literalExpression "{ nginx.bits = 3072; }";
5757 description = ''
5858 Diffie-Hellman parameters to generate.
5959
+1-1
nixos/modules/security/doas.nix
···7777 You can use <code>mkBefore</code> and/or <code>mkAfter</code> to ensure
7878 this is the case when configuration options are merged.
7979 '';
8080- example = literalExample ''
8080+ example = literalExpression ''
8181 [
8282 # Allow execution of any command by any user in group doas, requiring
8383 # a password and keeping any previously-defined environment variables.
···3333 additionalSearchPaths = mkOption {
3434 type = types.listOf types.package;
3535 default = [];
3636- example = literalExample "[ pkgs.bindfs ]";
3636+ example = literalExpression "[ pkgs.bindfs ]";
3737 description = ''
3838 Additional programs to include in the search path of pam_mount.
3939 Useful for example if you want to use some FUSE filesystems like bindfs.
···4343 fuseMountOptions = mkOption {
4444 type = types.listOf types.str;
4545 default = [];
4646- example = literalExample ''
4646+ example = literalExpression ''
4747 [ "nodev" "nosuid" "force-user=%(USER)" "gid=%(USERGID)" "perms=0700" "chmod-deny" "chown-deny" "chgrp-deny" ]
4848 '';
4949 description = ''
+2-2
nixos/modules/security/sudo.nix
···4545 security.sudo.package = mkOption {
4646 type = types.package;
4747 default = pkgs.sudo;
4848- defaultText = "pkgs.sudo";
4848+ defaultText = literalExpression "pkgs.sudo";
4949 description = ''
5050 Which package to use for `sudo`.
5151 '';
···9191 this is the case when configuration options are merged.
9292 '';
9393 default = [];
9494- example = literalExample ''
9494+ example = literalExpression ''
9595 [
9696 # Allow execution of any command by all users in group sudo,
9797 # requiring a password.
+2-2
nixos/modules/security/systemd-confinement.nix
···6262 options.confinement.binSh = lib.mkOption {
6363 type = types.nullOr types.path;
6464 default = toplevelConfig.environment.binsh;
6565- defaultText = "config.environment.binsh";
6666- example = lib.literalExample "\${pkgs.dash}/bin/dash";
6565+ defaultText = lib.literalExpression "config.environment.binsh";
6666+ example = lib.literalExpression ''"''${pkgs.dash}/bin/dash"'';
6767 description = ''
6868 The program to make available as <filename>/bin/sh</filename> inside
6969 the chroot. If this is set to <literal>null</literal>, no
+3-4
nixos/modules/security/tpm2.nix
···2626 '';
2727 type = lib.types.nullOr lib.types.str;
2828 default = if cfg.abrmd.enable then "tss" else "root";
2929- defaultText = ''"tss" when using the userspace resource manager,'' +
3030- ''"root" otherwise'';
2929+ defaultText = lib.literalExpression ''if config.security.tpm2.abrmd.enable then "tss" else "root"'';
3130 };
32313332 tssGroup = lib.mkOption {
···5756 description = "tpm2-abrmd package to use";
5857 type = lib.types.package;
5958 default = pkgs.tpm2-abrmd;
6060- defaultText = "pkgs.tpm2-abrmd";
5959+ defaultText = lib.literalExpression "pkgs.tpm2-abrmd";
6160 };
6261 };
6362···7170 description = "tpm2-pkcs11 package to use";
7271 type = lib.types.package;
7372 default = pkgs.tpm2-pkcs11;
7474- defaultText = "pkgs.tpm2-pkcs11";
7373+ defaultText = lib.literalExpression "pkgs.tpm2-pkcs11";
7574 };
7675 };
7776
+1-1
nixos/modules/security/wrappers/default.nix
···152152 security.wrappers = lib.mkOption {
153153 type = lib.types.attrsOf wrapperType;
154154 default = {};
155155- example = lib.literalExample
155155+ example = lib.literalExpression
156156 ''
157157 {
158158 # a setuid root program
+1-1
nixos/modules/services/admin/meshcentral.nix
···1010 description = "MeshCentral package to use. Replacing this may be necessary to add dependencies for extra functionality.";
1111 type = types.package;
1212 default = pkgs.meshcentral;
1313- defaultText = "pkgs.meshcentral";
1313+ defaultText = literalExpression "pkgs.meshcentral";
1414 };
1515 settings = mkOption {
1616 description = ''
+2-2
nixos/modules/services/admin/oxidized.nix
···33333434 configFile = mkOption {
3535 type = types.path;
3636- example = literalExample ''
3636+ example = literalExpression ''
3737 pkgs.writeText "oxidized-config.yml" '''
3838 ---
3939 debug: true
···69697070 routerDB = mkOption {
7171 type = types.path;
7272- example = literalExample ''
7272+ example = literalExpression ''
7373 pkgs.writeText "oxidized-router.db" '''
7474 hostname-sw1:powerconnect:username1:password2
7575 hostname-sw2:procurve:username2:password2
+2-1
nixos/modules/services/amqp/activemq/default.nix
···3333 };
3434 configurationDir = mkOption {
3535 default = "${activemq}/conf";
3636+ defaultText = literalExpression ''"''${pkgs.activemq}/conf"'';
3637 type = types.str;
3738 description = ''
3839 The base directory for ActiveMQ's configuration.
···6465 javaProperties = mkOption {
6566 type = types.attrs;
6667 default = { };
6767- example = literalExample ''
6868+ example = literalExpression ''
6869 {
6970 "java.net.preferIPv4Stack" = "true";
7071 }
···3939 extensionPackages = mkOption {
4040 default = [];
4141 type = types.listOf types.package;
4242- example = literalExample "[ pkgs.mopidy-spotify ]";
4242+ example = literalExpression "[ pkgs.mopidy-spotify ]";
4343 description = ''
4444 Mopidy extensions that should be loaded by the service.
4545 '';
+3-3
nixos/modules/services/audio/mpd.nix
···7474 musicDirectory = mkOption {
7575 type = with types; either path (strMatching "(http|https|nfs|smb)://.+");
7676 default = "${cfg.dataDir}/music";
7777- defaultText = "\${dataDir}/music";
7777+ defaultText = literalExpression ''"''${dataDir}/music"'';
7878 description = ''
7979 The directory or NFS/SMB network share where MPD reads music from. If left
8080 as the default value this directory will automatically be created before
···8686 playlistDirectory = mkOption {
8787 type = types.path;
8888 default = "${cfg.dataDir}/playlists";
8989- defaultText = "\${dataDir}/playlists";
8989+ defaultText = literalExpression ''"''${dataDir}/playlists"'';
9090 description = ''
9191 The directory where MPD stores playlists. If left as the default value
9292 this directory will automatically be created before the MPD server starts,
···155155 dbFile = mkOption {
156156 type = types.nullOr types.str;
157157 default = "${cfg.dataDir}/tag_cache";
158158- defaultText = "\${dataDir}/tag_cache";
158158+ defaultText = literalExpression ''"''${dataDir}/tag_cache"'';
159159 description = ''
160160 The path to MPD's database. If set to <literal>null</literal> the
161161 parameter is omitted from the configuration.
···206206 For type <literal>meta</literal>, a list of stream names in the form <literal>/one/two/...</literal>. Don't forget the leading slash.
207207 For type <literal>alsa</literal>, use an empty string.
208208 '';
209209- example = literalExample ''
209209+ example = literalExpression ''
210210 "/path/to/pipe"
211211 "/path/to/librespot"
212212 "192.168.1.2:4444"
···226226 description = ''
227227 Key-value pairs that convey additional parameters about a stream.
228228 '';
229229- example = literalExample ''
229229+ example = literalExpression ''
230230 # for type == "pipe":
231231 {
232232 mode = "create";
···254254 description = ''
255255 The definition for an input source.
256256 '';
257257- example = literalExample ''
257257+ example = literalExpression ''
258258 {
259259 mpd = {
260260 type = "pipe";
-1
nixos/modules/services/audio/ympd.nix
···2626 type = types.str;
2727 default = "localhost";
2828 description = "The host where MPD is listening.";
2929- example = "localhost";
3029 };
31303231 port = mkOption {
···203203 See also the chapter about BorgBackup in the NixOS manual.
204204 '';
205205 default = { };
206206- example = literalExample ''
206206+ example = literalExpression ''
207207 { # for a local backup
208208 rootBackup = {
209209 paths = "/";
···260260 archiveBaseName = mkOption {
261261 type = types.strMatching "[^/{}]+";
262262 default = "${globalConfig.networking.hostName}-${name}";
263263- defaultText = "\${config.networking.hostName}-<name>";
263263+ defaultText = literalExpression ''"''${config.networking.hostName}-<name>"'';
264264 description = ''
265265 How to name the created archives. A timestamp, whose format is
266266 determined by <option>dateFormat</option>, will be appended. The full
···326326 you to specify a <option>passCommand</option>
327327 or a <option>passphrase</option>.
328328 '';
329329- example = ''
330330- encryption.mode = "repokey-blake2" ;
331331- encryption.passphrase = "mySecretPassphrase" ;
332332- '';
329329+ example = "repokey-blake2";
333330 };
334331335332 encryption.passCommand = mkOption {
···437434 for the available options.
438435 '';
439436 default = { };
440440- example = literalExample ''
437437+ example = literalExpression ''
441438 {
442439 within = "1d"; # Keep all archives from the last day
443440 daily = 7;
···455452 Use <literal>""</literal> to consider all archives.
456453 '';
457454 default = config.archiveBaseName;
458458- defaultText = "\${archiveBaseName}";
455455+ defaultText = literalExpression "archiveBaseName";
459456 };
460457461458 environment = mkOption {
+1-1
nixos/modules/services/backup/btrbk.nix
···5757 description = "Extra packages for btrbk, like compression utilities for <literal>stream_compress</literal>";
5858 type = lib.types.listOf lib.types.package;
5959 default = [ ];
6060- example = lib.literalExample "[ pkgs.xz ]";
6060+ example = lib.literalExpression "[ pkgs.xz ]";
6161 };
6262 niceness = lib.mkOption {
6363 description = "Niceness for local instances of btrbk. Also applies to remote ones connecting via ssh when positive.";
···132132 package = mkOption {
133133 type = types.package;
134134 default = pkgs.slurm.override { enableX11 = ! cfg.enableSrunX11; };
135135- defaultText = "pkgs.slurm";
136136- example = literalExample "pkgs.slurm-full";
135135+ defaultText = literalExpression "pkgs.slurm";
136136+ example = literalExpression "pkgs.slurm-full";
137137 description = ''
138138 The package to use for slurm binaries.
139139 '';
···172172 nodeName = mkOption {
173173 type = types.listOf types.str;
174174 default = [];
175175- example = literalExample ''[ "linux[1-32] CPUs=1 State=UNKNOWN" ];'';
175175+ example = literalExpression ''[ "linux[1-32] CPUs=1 State=UNKNOWN" ];'';
176176 description = ''
177177 Name that SLURM uses to refer to a node (or base partition for BlueGene
178178 systems). Typically this would be the string that "/bin/hostname -s"
···183183 partitionName = mkOption {
184184 type = types.listOf types.str;
185185 default = [];
186186- example = literalExample ''[ "debug Nodes=linux[1-32] Default=YES MaxTime=INFINITE State=UP" ];'';
186186+ example = literalExpression ''[ "debug Nodes=linux[1-32] Default=YES MaxTime=INFINITE State=UP" ];'';
187187 description = ''
188188 Name by which the partition may be referenced. Note that now you have
189189 to write the partition's parameters after the name.
···34343535 package = mkOption {
3636 type = types.package;
3737- example = literalExample "pkgs.mariadb";
3737+ example = literalExpression "pkgs.mariadb";
3838 description = "
3939 Which MySQL derivation to use. MariaDB packages are supported too.
4040 ";
···4343 bind = mkOption {
4444 type = types.nullOr types.str;
4545 default = null;
4646- example = literalExample "0.0.0.0";
4646+ example = "0.0.0.0";
4747 description = "Address to bind to. The default is to bind to all addresses.";
4848 };
4949···7474 configFile = mkOption {
7575 type = types.path;
7676 default = settingsFile;
7777- defaultText = "settingsFile";
7777+ defaultText = literalExpression "settingsFile";
7878 description = ''
7979 Override the configuration file used by MySQL. By default,
8080 NixOS generates one automatically from <option>services.mysql.settings</option>.
8181 '';
8282- example = literalExample ''
8282+ example = literalExpression ''
8383 pkgs.writeText "my.cnf" '''
8484 [mysqld]
8585 datadir = /var/lib/mysql
···109109 </para>
110110 </note>
111111 '';
112112- example = literalExample ''
112112+ example = literalExpression ''
113113 {
114114 mysqld = {
115115 key_buffer_size = "6G";
···167167 of MySQL. The schema attribute is optional: If not specified, an empty database is created.
168168 '';
169169 example = [
170170- { name = "foodatabase"; schema = literalExample "./foodatabase.sql"; }
170170+ { name = "foodatabase"; schema = literalExpression "./foodatabase.sql"; }
171171 { name = "bardatabase"; }
172172 ];
173173 };
···217217 <link xlink:href="https://mariadb.com/kb/en/library/grant/">GRANT syntax</link>.
218218 The attributes are used as <code>GRANT ''${attrName} ON ''${attrValue}</code>.
219219 '';
220220- example = literalExample ''
220220+ example = literalExpression ''
221221 {
222222 "database.*" = "ALL PRIVILEGES";
223223 "*.*" = "SELECT, LOCK TABLES";
···235235 option is changed. This means that users created and permissions assigned once through this option or
236236 otherwise have to be removed manually.
237237 '';
238238- example = literalExample ''
238238+ example = literalExpression ''
239239 [
240240 {
241241 name = "nextcloud";
···44444545 package = mkOption {
4646 type = types.package;
4747- example = literalExample "pkgs.postgresql_11";
4747+ example = literalExpression "pkgs.postgresql_11";
4848 description = ''
4949 PostgreSQL package to use.
5050 '';
···66666767 dataDir = mkOption {
6868 type = types.path;
6969- defaultText = "/var/lib/postgresql/\${config.services.postgresql.package.psqlSchema}";
6969+ defaultText = literalExpression ''"/var/lib/postgresql/''${config.services.postgresql.package.psqlSchema}"'';
7070 example = "/var/lib/postgresql/11";
7171 description = ''
7272 The data directory for PostgreSQL. If left as the default value
···161161 <link xlink:href="https://www.postgresql.org/docs/current/sql-grant.html">GRANT syntax</link>.
162162 The attributes are used as <code>GRANT ''${attrValue} ON ''${attrName}</code>.
163163 '';
164164- example = literalExample ''
164164+ example = literalExpression ''
165165 {
166166 "DATABASE \"nextcloud\"" = "ALL PRIVILEGES";
167167 "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
···179179 option is changed. This means that users created and permissions assigned once through this option or
180180 otherwise have to be removed manually.
181181 '';
182182- example = literalExample ''
182182+ example = literalExpression ''
183183 [
184184 {
185185 name = "nextcloud";
···221221 extraPlugins = mkOption {
222222 type = types.listOf types.path;
223223 default = [];
224224- example = literalExample "with pkgs.postgresql_11.pkgs; [ postgis pg_repack ]";
224224+ example = literalExpression "with pkgs.postgresql_11.pkgs; [ postgis pg_repack ]";
225225 description = ''
226226 List of PostgreSQL plugins. PostgreSQL version for each plugin should
227227 match version for <literal>services.postgresql.package</literal> value.
···241241 escaped with two single quotes as described by the upstream documentation linked above.
242242 </para></note>
243243 '';
244244- example = literalExample ''
244244+ example = literalExpression ''
245245 {
246246 log_connections = true;
247247 log_statement = "all";
+2-3
nixos/modules/services/databases/redis.nix
···4747 package = mkOption {
4848 type = types.package;
4949 default = pkgs.redis;
5050- defaultText = "pkgs.redis";
5050+ defaultText = literalExpression "pkgs.redis";
5151 description = "Which Redis derivation to use.";
5252 };
5353···133133 type = with types; listOf (listOf int);
134134 default = [ [900 1] [300 10] [60 10000] ];
135135 description = "The schedule in which data is persisted to disk, represented as a list of lists where the first element represent the amount of seconds and the second the number of changes.";
136136- example = [ [900 1] [300 10] [60 10000] ];
137136 };
138137139138 slaveOf = mkOption {
···217216 <link xlink:href="https://redis.io/topics/config"/>
218217 for details on supported values.
219218 '';
220220- example = literalExample ''
219219+ example = literalExpression ''
221220 {
222221 loadmodule = [ "/path/to/my_module.so" "/path/to/other_module.so" ];
223222 }
···1313 package = mkOption {
1414 type = types.package;
1515 default = pkgs.greetd.greetd;
1616- defaultText = "pkgs.greetd.greetd";
1616+ defaultText = literalExpression "pkgs.greetd.greetd";
1717 description = "The greetd package that should be used.";
1818 };
19192020 settings = mkOption {
2121 type = settingsFormat.type;
2222- example = literalExample ''
2222+ example = literalExpression ''
2323 {
2424 default_session = {
2525 command = "''${pkgs.greetd.greetd}/bin/agreety --cmd sway";
···4343 restart = mkOption {
4444 type = types.bool;
4545 default = !(cfg.settings ? initial_session);
4646- defaultText = "!(config.services.greetd.settings ? initial_session)";
4646+ defaultText = literalExpression "!(config.services.greetd.settings ? initial_session)";
4747 description = ''
4848 Wether to restart greetd when it terminates (e.g. on failure).
4949 This is usually desirable so a user can always log in, but should be disabled when using 'settings.initial_session' (autologin),
···1818 package = mkOption {
1919 type = types.package;
2020 default = pkgs.crossfire-server;
2121- defaultText = "pkgs.crossfire-server";
2121+ defaultText = literalExpression "pkgs.crossfire-server";
2222 description = ''
2323 The package to use for the Crossfire server (and map/arch data, if you
2424 don't change dataDir).
···2828 dataDir = mkOption {
2929 type = types.str;
3030 default = "${cfg.package}/share/crossfire";
3131- defaultText = "\${config.services.crossfire.package}/share/crossfire";
3131+ defaultText = literalExpression ''"''${config.services.crossfire.package}/share/crossfire"'';
3232 description = ''
3333 Where to load readonly data from -- maps, archetypes, treasure tables,
3434 and the like. If you plan to edit the data on the live server (rather
···7272 overwrite the example files that come with the server, rather than being
7373 appended to them as the other configuration files are.
7474 '';
7575- example = literalExample ''
7676- dm_file = '''
7777- admin:secret_password:localhost
7878- jane:xyzzy:*
7979- ''';
8080- ban_file = '''
8181- # Bob is a jerk
8282- bob@*
8383- # So is everyone on 192.168.86.255/24
8484- *@192.168.86.
8585- ''';
8686- metaserver2 = '''
8787- metaserver2_notification on
8888- localhostname crossfire.example.net
8989- ''';
9090- motd = "Welcome to CrossFire!";
9191- news = "No news yet.";
9292- rules = "Don't be a jerk.";
9393- settings = '''
9494- # be nicer to newbies and harsher to experienced players
9595- balanced_stat_loss true
9696- # don't let players pick up and use admin-created items
9797- real_wiz false
9898- ''';
7575+ example = literalExpression ''
7676+ {
7777+ dm_file = '''
7878+ admin:secret_password:localhost
7979+ jane:xyzzy:*
8080+ ''';
8181+ ban_file = '''
8282+ # Bob is a jerk
8383+ bob@*
8484+ # So is everyone on 192.168.86.255/24
8585+ *@192.168.86.
8686+ ''';
8787+ metaserver2 = '''
8888+ metaserver2_notification on
8989+ localhostname crossfire.example.net
9090+ ''';
9191+ motd = "Welcome to CrossFire!";
9292+ news = "No news yet.";
9393+ rules = "Don't be a jerk.";
9494+ settings = '''
9595+ # be nicer to newbies and harsher to experienced players
9696+ balanced_stat_loss true
9797+ # don't let players pick up and use admin-created items
9898+ real_wiz false
9999+ ''';
100100+ }
99101 '';
100102 default = {};
101103 };
+20-18
nixos/modules/services/games/deliantra-server.nix
···1818 package = mkOption {
1919 type = types.package;
2020 default = pkgs.deliantra-server;
2121- defaultText = "pkgs.deliantra-server";
2121+ defaultText = literalExpression "pkgs.deliantra-server";
2222 description = ''
2323 The package to use for the Deliantra server (and map/arch data, if you
2424 don't change dataDir).
···2828 dataDir = mkOption {
2929 type = types.str;
3030 default = "${pkgs.deliantra-data}";
3131- defaultText = "\${pkgs.deliantra-data}";
3131+ defaultText = literalExpression ''"''${pkgs.deliantra-data}"'';
3232 description = ''
3333 Where to store readonly data (maps, archetypes, sprites, etc).
3434 Note that if you plan to use the live map editor (rather than editing
···6969 The example here is not comprehensive. See the files in
7070 /etc/deliantra-server after enabling this module for full documentation.
7171 '';
7272- example = literalExample ''
7373- dm_file = '''
7474- admin:secret_password:localhost
7575- jane:xyzzy:*
7676- ''';
7777- motd = "Welcome to Deliantra!";
7878- settings = '''
7979- # Settings for game mechanics.
8080- stat_loss_on_death true
8181- armor_max_enchant 7
8282- ''';
8383- config = '''
8484- # Settings for the server daemon.
8585- hiscore_url https://deliantra.example.net/scores/
8686- max_map_reset 86400
8787- ''';
7272+ example = literalExpression ''
7373+ {
7474+ dm_file = '''
7575+ admin:secret_password:localhost
7676+ jane:xyzzy:*
7777+ ''';
7878+ motd = "Welcome to Deliantra!";
7979+ settings = '''
8080+ # Settings for game mechanics.
8181+ stat_loss_on_death true
8282+ armor_max_enchant 7
8383+ ''';
8484+ config = '''
8585+ # Settings for the server daemon.
8686+ hiscore_url https://deliantra.example.net/scores/
8787+ max_map_reset 86400
8888+ ''';
8989+ }
8890 '';
8991 default = {
9092 motd = "";
+3-3
nixos/modules/services/games/factorio.nix
···8686 configFile = mkOption {
8787 type = types.path;
8888 default = configFile;
8989- defaultText = "configFile";
8989+ defaultText = literalExpression "configFile";
9090 description = ''
9191 The server's configuration file.
9292···162162 package = mkOption {
163163 type = types.package;
164164 default = pkgs.factorio-headless;
165165- defaultText = "pkgs.factorio-headless";
166166- example = "pkgs.factorio-headless-experimental";
165165+ defaultText = literalExpression "pkgs.factorio-headless";
166166+ example = literalExpression "pkgs.factorio-headless-experimental";
167167 description = ''
168168 Factorio version to use. This defaults to the stable channel.
169169 '';
+4-4
nixos/modules/services/games/minecraft-server.nix
···109109 You can use <link xlink:href="https://mcuuid.net/"/> to get a
110110 Minecraft UUID for a username.
111111 '';
112112- example = literalExample ''
112112+ example = literalExpression ''
113113 {
114114 username1 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
115115 username2 = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy";
···120120 serverProperties = mkOption {
121121 type = with types; attrsOf (oneOf [ bool int str ]);
122122 default = {};
123123- example = literalExample ''
123123+ example = literalExpression ''
124124 {
125125 server-port = 43000;
126126 difficulty = 3;
···144144 package = mkOption {
145145 type = types.package;
146146 default = pkgs.minecraft-server;
147147- defaultText = "pkgs.minecraft-server";
148148- example = literalExample "pkgs.minecraft-server_1_12_2";
147147+ defaultText = literalExpression "pkgs.minecraft-server";
148148+ example = literalExpression "pkgs.minecraft-server_1_12_2";
149149 description = "Version of minecraft-server to run.";
150150 };
151151
···8080 extraTrustedKeys = mkOption {
8181 type = types.listOf types.path;
8282 default = [];
8383- example = literalExample "[ /etc/nixos/fwupd/myfirmware.pem ]";
8383+ example = literalExpression "[ /etc/nixos/fwupd/myfirmware.pem ]";
8484 description = ''
8585 Installing a public key allows firmware signed with a matching private key to be recognized as trusted, which may require less authentication to install than for untrusted files. By default trusted firmware can be upgraded (but not downgraded) without the user or administrator password. Only very few keys are installed by default.
8686 '';
···9898 package = mkOption {
9999 type = types.package;
100100 default = pkgs.fwupd;
101101+ defaultText = literalExpression "pkgs.fwupd";
101102 description = ''
102103 Which fwupd package to use.
103104 '';
···1515 plugins = mkOption {
1616 type = types.listOf types.package;
1717 default = [ pkgs.interception-tools-plugins.caps2esc ];
1818+ defaultText = literalExpression "[ pkgs.interception-tools-plugins.caps2esc ]";
1819 description = ''
1920 A list of interception tools plugins that will be made available to use
2021 inside the udevmon configuration.
+2-2
nixos/modules/services/hardware/pcscd.nix
···2121 plugins = mkOption {
2222 type = types.listOf types.package;
2323 default = [ pkgs.ccid ];
2424- defaultText = "[ pkgs.ccid ]";
2525- example = literalExample "[ pkgs.pcsc-cyberjack ]";
2424+ defaultText = literalExpression "[ pkgs.ccid ]";
2525+ example = literalExpression "[ pkgs.pcsc-cyberjack ]";
2626 description = "Plugin packages to be used for PCSC-Lite.";
2727 };
2828
+2-1
nixos/modules/services/hardware/sane.nix
···7373 The example contains the package for HP scanners.
7474 </para></note>
7575 '';
7676- example = literalExample "[ pkgs.hplipWithPlugin ]";
7676+ example = literalExpression "[ pkgs.hplipWithPlugin ]";
7777 };
78787979 hardware.sane.disabledDefaultBackends = mkOption {
···115115 hardware.sane.drivers.scanSnap.package = mkOption {
116116 type = types.package;
117117 default = pkgs.sane-drivers.epjitsu;
118118+ defaultText = literalExpression "pkgs.sane-drivers.epjitsu";
118119 description = ''
119120 Epjitsu driver package to use. Useful if you want to extract the driver files yourself.
120121
···2020 the name of attribute will be used.
2121 '';
22222323- example = literalExample "office1";
2323+ example = "office1";
2424 };
25252626 model = mkOption {
···2929 The model of the network device.
3030 '';
31313232- example = literalExample "MFC-7860DW";
3232+ example = "MFC-7860DW";
3333 };
34343535 ip = mkOption {
···4040 provide a nodename.
4141 '';
42424343- example = literalExample "192.168.1.2";
4343+ example = "192.168.1.2";
4444 };
45454646 nodename = mkOption {
···5151 provide an ip.
5252 '';
53535454- example = literalExample "BRW0080927AFBCE";
5454+ example = "BRW0080927AFBCE";
5555 };
56565757 };
···2020 the name of attribute will be used.
2121 '';
22222323- example = literalExample "office1";
2323+ example = "office1";
2424 };
25252626 model = mkOption {
···2929 The model of the network device.
3030 '';
31313232- example = literalExample "ADS-1200";
3232+ example = "ADS-1200";
3333 };
34343535 ip = mkOption {
···4040 provide a nodename.
4141 '';
42424343- example = literalExample "192.168.1.2";
4343+ example = "192.168.1.2";
4444 };
45454646 nodename = mkOption {
···5151 provide an ip.
5252 '';
53535454- example = literalExample "BRW0080927AFBCE";
5454+ example = "BRW0080927AFBCE";
5555 };
56565757 };
···3838 package = mkOption {
3939 type = types.package;
4040 default = pkgs.graylog;
4141- defaultText = "pkgs.graylog";
4141+ defaultText = literalExpression "pkgs.graylog";
4242 description = "Graylog package to use.";
4343 };
44444545 user = mkOption {
4646 type = types.str;
4747 default = "graylog";
4848- example = literalExample "graylog";
4948 description = "User account under which graylog runs";
5049 };
5150···90899190 elasticsearchHosts = mkOption {
9291 type = types.listOf types.str;
9393- example = literalExample ''[ "http://node1:9200" "http://user:password@node2:19200" ]'';
9292+ example = literalExpression ''[ "http://node1:9200" "http://user:password@node2:19200" ]'';
9493 description = "List of valid URIs of the http ports of your elastic nodes. If one or more of your elasticsearch hosts require authentication, include the credentials in each node URI that requires authentication";
9594 };
9695
+2-2
nixos/modules/services/logging/journalbeat.nix
···2727 package = mkOption {
2828 type = types.package;
2929 default = pkgs.journalbeat;
3030- defaultText = "pkgs.journalbeat";
3131- example = literalExample "pkgs.journalbeat7";
3030+ defaultText = literalExpression "pkgs.journalbeat";
3131+ example = literalExpression "pkgs.journalbeat7";
3232 description = ''
3333 The journalbeat package to use
3434 '';
+1-1
nixos/modules/services/logging/logcheck.nix
···172172173173 extraRulesDirs = mkOption {
174174 default = [];
175175- example = "/etc/logcheck";
175175+ example = [ "/etc/logcheck" ];
176176 type = types.listOf types.path;
177177 description = ''
178178 Directories with extra rules.
+1-1
nixos/modules/services/logging/logrotate.nix
···111111 can be controlled by the <link linkend="opt-services.logrotate.paths._name_.priority">priority</link> option
112112 using the same semantics as `lib.mkOrder`. Smaller values have a greater priority.
113113 '';
114114- example = literalExample ''
114114+ example = literalExpression ''
115115 {
116116 httpd = {
117117 path = "/var/log/httpd/*.log";
···6868 plugins = mkOption {
6969 type = types.functionTo (types.listOf types.package);
7070 default = plugins: [];
7171- defaultText = "plugins: []";
7272- example = literalExample "plugins: with plugins; [ themeify stlviewer ]";
7171+ defaultText = literalExpression "plugins: []";
7272+ example = literalExpression "plugins: with plugins; [ themeify stlviewer ]";
7373 description = "Additional plugins to be used. Available plugins are passed through the plugins input.";
7474 };
7575
+4-4
nixos/modules/services/misc/paperless-ng.nix
···107107 mediaDir = mkOption {
108108 type = types.str;
109109 default = "${cfg.dataDir}/media";
110110- defaultText = "\${dataDir}/consume";
110110+ defaultText = literalExpression ''"''${dataDir}/media"'';
111111 description = "Directory to store the Paperless documents.";
112112 };
113113114114 consumptionDir = mkOption {
115115 type = types.str;
116116 default = "${cfg.dataDir}/consume";
117117- defaultText = "\${dataDir}/consume";
117117+ defaultText = literalExpression ''"''${dataDir}/consume"'';
118118 description = "Directory from which new documents are imported.";
119119 };
120120···167167 See <link xlink:href="https://paperless-ng.readthedocs.io/en/latest/configuration.html">the documentation</link>
168168 for available options.
169169 '';
170170- example = literalExample ''
170170+ example = literalExpression ''
171171 {
172172 PAPERLESS_OCR_LANGUAGE = "deu+eng";
173173 }
···183183 package = mkOption {
184184 type = types.package;
185185 default = pkgs.paperless-ng;
186186- defaultText = "pkgs.paperless-ng";
186186+ defaultText = literalExpression "pkgs.paperless-ng";
187187 description = "The Paperless package to use.";
188188 };
189189 };
+1-1
nixos/modules/services/misc/plex.nix
···6868 package = mkOption {
6969 type = types.package;
7070 default = pkgs.plex;
7171- defaultText = "pkgs.plex";
7171+ defaultText = literalExpression "pkgs.plex";
7272 description = ''
7373 The Plex package to use. Plex subscribers may wish to use their own
7474 package here, pointing to subscriber-only server versions.
+9-8
nixos/modules/services/misc/redmine.nix
···2233let
44 inherit (lib) mkBefore mkDefault mkEnableOption mkIf mkOption mkRemovedOptionModule types;
55- inherit (lib) concatStringsSep literalExample mapAttrsToList;
55+ inherit (lib) concatStringsSep literalExpression mapAttrsToList;
66 inherit (lib) optional optionalAttrs optionalString;
7788 cfg = config.services.redmine;
···5454 package = mkOption {
5555 type = types.package;
5656 default = pkgs.redmine;
5757+ defaultText = literalExpression "pkgs.redmine";
5758 description = "Which Redmine package to use.";
5858- example = "pkgs.redmine.override { ruby = pkgs.ruby_2_7; }";
5959+ example = literalExpression "pkgs.redmine.override { ruby = pkgs.ruby_2_7; }";
5960 };
60616162 user = mkOption {
···9091 <link xlink:href="https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration"/>
9192 for details.
9293 '';
9393- example = literalExample ''
9494+ example = literalExpression ''
9495 {
9596 email_delivery = {
9697 delivery_method = "smtp";
···112113 See <link xlink:href="https://svn.redmine.org/redmine/trunk/config/additional_environment.rb.example"/>
113114 for details.
114115 '';
115115- example = literalExample ''
116116+ example = ''
116117 config.logger.level = Logger::DEBUG
117118 '';
118119 };
···121122 type = types.attrsOf types.path;
122123 default = {};
123124 description = "Set of themes.";
124124- example = literalExample ''
125125+ example = literalExpression ''
125126 {
126127 dkuk-redmine_alex_skin = builtins.fetchurl {
127128 url = "https://bitbucket.org/dkuk/redmine_alex_skin/get/1842ef675ef3.zip";
···135136 type = types.attrsOf types.path;
136137 default = {};
137138 description = "Set of plugins.";
138138- example = literalExample ''
139139+ example = literalExpression ''
139140 {
140141 redmine_env_auth = builtins.fetchurl {
141142 url = "https://github.com/Intera/redmine_env_auth/archive/0.6.zip";
···162163 port = mkOption {
163164 type = types.int;
164165 default = if cfg.database.type == "postgresql" then 5432 else 3306;
165165- defaultText = "3306";
166166+ defaultText = literalExpression "3306";
166167 description = "Database host port.";
167168 };
168169···194195 if mysqlLocal then "/run/mysqld/mysqld.sock"
195196 else if pgsqlLocal then "/run/postgresql"
196197 else null;
197197- defaultText = "/run/mysqld/mysqld.sock";
198198+ defaultText = literalExpression "/run/mysqld/mysqld.sock";
198199 example = "/run/mysqld/mysqld.sock";
199200 description = "Path to the unix socket file to use for authentication.";
200201 };
···9393 transcoders = mkOption {
9494 type = types.listOf types.path;
9595 default = [ "${pkgs.ffmpeg.bin}/bin/ffmpeg" ];
9696+ defaultText = literalExpression ''[ "''${pkgs.ffmpeg.bin}/bin/ffmpeg" ]'';
9697 description = ''
9798 List of paths to transcoder executables that should be accessible
9899 from Subsonic. Symlinks will be created to each executable inside
···3232 bind = mkOption {
3333 type = types.str;
3434 default = "0.0.0.0";
3535- example = literalExample "0.0.0.0";
3635 description = "Address to bind to. The default is to bind to all addresses";
3736 };
3837···4645 type = types.str;
4746 description = "URL of the MongoDB or PostgreSQL database to connect to";
4847 default = "mongodb://localhost";
4949- example = "mongodb://localhost";
5048 };
51495250 databaseName = mkOption {
5351 type = types.str;
5452 description = "Name of the database instance to connect to";
5553 default = "monitoring";
5656- example = "monitoring";
5754 };
58555956 corsOrigins = mkOption {
6057 type = types.listOf types.str;
6158 description = "List of URLs that can access the API for Cross-Origin Resource Sharing (CORS)";
6259 example = [ "http://localhost" "http://localhost:5000" ];
6363- default = [ "http://localhost" "http://localhost:5000" ];
6460 };
65616662 authenticationRequired = mkOption {
+1-2
nixos/modules/services/monitoring/arbtt.nix
···1818 package = mkOption {
1919 type = types.package;
2020 default = pkgs.haskellPackages.arbtt;
2121- defaultText = "pkgs.haskellPackages.arbtt";
2222- example = literalExample "pkgs.haskellPackages.arbtt";
2121+ defaultText = literalExpression "pkgs.haskellPackages.arbtt";
2322 description = ''
2423 The package to use for the arbtt binaries.
2524 '';
···330330 staticRootPath = mkOption {
331331 description = "Root path for static assets.";
332332 default = "${cfg.package}/share/grafana/public";
333333+ defaultText = literalExpression ''"''${package}/share/grafana/public"'';
333334 type = types.str;
334335 };
335336336337 package = mkOption {
337338 description = "Package to use.";
338339 default = pkgs.grafana;
339339- defaultText = "pkgs.grafana";
340340+ defaultText = literalExpression "pkgs.grafana";
340341 type = types.package;
341342 };
342343···344345 type = with types; nullOr (listOf path);
345346 default = null;
346347 description = "If non-null, then a list of packages containing Grafana plugins to install. If set, plugins cannot be manually installed.";
347347- example = literalExample "with pkgs.grafanaPlugins; [ grafana-piechart-panel ]";
348348+ example = literalExpression "with pkgs.grafanaPlugins; [ grafana-piechart-panel ]";
348349 # Make sure each plugin is added only once; otherwise building
349350 # the link farm fails, since the same path is added multiple
350351 # times.
+3-3
nixos/modules/services/monitoring/graphite.nix
···132132 finders = mkOption {
133133 description = "List of finder plugins to load.";
134134 default = [];
135135- example = literalExample "[ pkgs.python3Packages.influxgraph ]";
135135+ example = literalExpression "[ pkgs.python3Packages.influxgraph ]";
136136 type = types.listOf types.package;
137137 };
138138···160160 package = mkOption {
161161 description = "Package to use for graphite api.";
162162 default = pkgs.python3Packages.graphite_api;
163163- defaultText = "pkgs.python3Packages.graphite_api";
163163+ defaultText = literalExpression "pkgs.python3Packages.graphite_api";
164164 type = types.package;
165165 };
166166···335335 <link xlink:href='https://github.com/scobal/seyren#config' />
336336 '';
337337 type = types.attrsOf types.str;
338338- example = literalExample ''
338338+ example = literalExpression ''
339339 {
340340 GRAPHITE_USERNAME = "user";
341341 GRAPHITE_PASSWORD = "pass";
+1-1
nixos/modules/services/monitoring/heapster.nix
···3333 package = mkOption {
3434 description = "Package to use by heapster";
3535 default = pkgs.heapster;
3636- defaultText = "pkgs.heapster";
3636+ defaultText = literalExpression "pkgs.heapster";
3737 type = types.package;
3838 };
3939 };
+1-1
nixos/modules/services/monitoring/incron.nix
···5656 extraPackages = mkOption {
5757 type = types.listOf types.package;
5858 default = [];
5959- example = literalExample "[ pkgs.rsync ]";
5959+ example = literalExpression "[ pkgs.rsync ]";
6060 description = "Extra packages available to the system incrontab.";
6161 };
6262
+1-4
nixos/modules/services/monitoring/kapacitor.nix
···6262 dataDir = mkOption {
6363 type = types.path;
6464 example = "/var/lib/kapacitor";
6565- default = "/var/lib/kapacitor";
6665 description = "Location where Kapacitor stores its state";
6766 };
6867···7574 bind = mkOption {
7675 type = types.str;
7776 default = "";
7878- example = literalExample "0.0.0.0";
7777+ example = "0.0.0.0";
7978 description = "Address to bind to. The default is to bind to all addresses";
8079 };
8180···101100 type = types.str;
102101 description = "Specifies how often to snapshot the task state (in InfluxDB time units)";
103102 default = "1m0s";
104104- example = "1m0s";
105103 };
106104107105 loadDirectory = mkOption {
···136134 url = mkOption {
137135 description = "The URL to the Alerta REST API";
138136 default = "http://localhost:5000";
139139- example = "http://localhost:5000";
140137 type = types.str;
141138 };
142139
+2-2
nixos/modules/services/monitoring/loki.nix
···11{ config, lib, pkgs, ... }:
2233let
44- inherit (lib) escapeShellArgs literalExample mkEnableOption mkIf mkOption types;
44+ inherit (lib) escapeShellArgs mkEnableOption mkIf mkOption types;
5566 cfg = config.services.loki;
77···5757 extraFlags = mkOption {
5858 type = types.listOf types.str;
5959 default = [];
6060- example = literalExample [ "--server.http-listen-port=3101" ];
6060+ example = [ "--server.http-listen-port=3101" ];
6161 description = ''
6262 Specify a list of additional command line flags,
6363 which get escaped and are then passed to Loki.
···19192020 apiKeyFile = mkOption {
2121 type = types.path;
2222- default = "";
2322 example = "/run/keys/mackerel-api-key";
2423 description = ''
2524 Path to file containing the Mackerel API key. The file should contain a
+3-4
nixos/modules/services/monitoring/metricbeat.nix
···33let
44 inherit (lib)
55 attrValues
66- literalExample
66+ literalExpression
77 mkEnableOption
88 mkIf
99 mkOption
···2424 package = mkOption {
2525 type = types.package;
2626 default = pkgs.metricbeat;
2727- defaultText = literalExample "pkgs.metricbeat";
2828- example = literalExample "pkgs.metricbeat7";
2727+ defaultText = literalExpression "pkgs.metricbeat";
2828+ example = literalExpression "pkgs.metricbeat7";
2929 description = ''
3030 The metricbeat package to use
3131 '';
···5151 module = mkOption {
5252 type = types.str;
5353 default = name;
5454- defaultText = literalExample ''<name>'';
5554 description = ''
5655 The name of the module.
5756
+7-5
nixos/modules/services/monitoring/munin.nix
···189189 <literal>/bin</literal>, <literal>/usr/bin</literal>,
190190 <literal>/sbin</literal>, and <literal>/usr/sbin</literal>.
191191 '';
192192- example = literalExample ''
192192+ example = literalExpression ''
193193 {
194194 zfs_usage_bigpool = /src/munin-contrib/plugins/zfs/zfs_usage_;
195195 zfs_usage_smallpool = /src/munin-contrib/plugins/zfs/zfs_usage_;
···220220 <literal>/bin</literal>, <literal>/usr/bin</literal>,
221221 <literal>/sbin</literal>, and <literal>/usr/sbin</literal>.
222222 '';
223223- example = literalExample ''
223223+ example = literalExpression ''
224224 [
225225 /src/munin-contrib/plugins/zfs
226226 /src/munin-contrib/plugins/ssh
···285285 host for cron to succeed. See
286286 <link xlink:href='http://guide.munin-monitoring.org/en/latest/reference/munin.conf.html' />
287287 '';
288288- example = ''
289289- [''${config.networking.hostName}]
290290- address localhost
288288+ example = literalExpression ''
289289+ '''
290290+ [''${config.networking.hostName}]
291291+ address localhost
292292+ '''
291293 '';
292294 };
293295
+4-4
nixos/modules/services/monitoring/nagios.nix
···9797 network that you want Nagios to monitor.
9898 ";
9999 type = types.listOf types.path;
100100- example = literalExample "[ ./objects.cfg ]";
100100+ example = literalExpression "[ ./objects.cfg ]";
101101 };
102102103103 plugins = mkOption {
104104 type = types.listOf types.package;
105105 default = with pkgs; [ monitoring-plugins ssmtp mailutils ];
106106- defaultText = "[pkgs.monitoring-plugins pkgs.ssmtp pkgs.mailutils]";
106106+ defaultText = literalExpression "[pkgs.monitoring-plugins pkgs.ssmtp pkgs.mailutils]";
107107 description = "
108108 Packages to be added to the Nagios <envar>PATH</envar>.
109109 Typically used to add plugins, but can be anything.
···137137 cgiConfigFile = mkOption {
138138 type = types.package;
139139 default = nagiosCGICfgFile;
140140- defaultText = "nagiosCGICfgFile";
140140+ defaultText = literalExpression "nagiosCGICfgFile";
141141 description = "
142142 Derivation for the configuration file of Nagios CGI scripts
143143 that can be used in web servers for running the Nagios web interface.
···155155156156 virtualHost = mkOption {
157157 type = types.submodule (import ../web-servers/apache-httpd/vhost-options.nix);
158158- example = literalExample ''
158158+ example = literalExpression ''
159159 { hostName = "example.org";
160160 adminAddr = "webmaster@example.org";
161161 enableSSL = true;
···2626 package = mkOption {
2727 type = types.package;
2828 default = pkgs.prometheus-pushgateway;
2929- defaultText = "pkgs.prometheus-pushgateway";
2929+ defaultText = literalExpression "pkgs.prometheus-pushgateway";
3030 description = ''
3131 Package that should be used for the prometheus pushgateway.
3232 '';
+2-3
nixos/modules/services/monitoring/scollector.nix
···4343 package = mkOption {
4444 type = types.package;
4545 default = pkgs.scollector;
4646- defaultText = "pkgs.scollector";
4747- example = literalExample "pkgs.scollector";
4646+ defaultText = literalExpression "pkgs.scollector";
4847 description = ''
4948 scollector binary to use.
5049 '';
···7877 collectors = mkOption {
7978 type = with types; attrsOf (listOf path);
8079 default = {};
8181- example = literalExample "{ \"0\" = [ \"\${postgresStats}/bin/collect-stats\" ]; }";
8080+ example = literalExpression ''{ "0" = [ "''${postgresStats}/bin/collect-stats" ]; }'';
8281 description = ''
8382 An attribute set mapping the frequency of collection to a list of
8483 binaries that should be executed at that frequency. You can use "0"
+2-2
nixos/modules/services/monitoring/telegraf.nix
···15151616 package = mkOption {
1717 default = pkgs.telegraf;
1818- defaultText = "pkgs.telegraf";
1818+ defaultText = literalExpression "pkgs.telegraf";
1919 description = "Which telegraf derivation to use";
2020 type = types.package;
2121 };
···2323 environmentFiles = mkOption {
2424 type = types.listOf types.path;
2525 default = [];
2626- example = "/run/keys/telegraf.env";
2626+ example = [ "/run/keys/telegraf.env" ];
2727 description = ''
2828 File to load as environment file. Environment variables from this file
2929 will be interpolated into the config file using envsubst with this
+4-4
nixos/modules/services/monitoring/thanos.nix
···120120 type = with types; nullOr str;
121121 default = if cfg.tracing.config == null then null
122122 else toString (toYAML "tracing.yaml" cfg.tracing.config);
123123- defaultText = ''
123123+ defaultText = literalExpression ''
124124 if config.services.thanos.<cmd>.tracing.config == null then null
125125 else toString (toYAML "tracing.yaml" config.services.thanos.<cmd>.tracing.config);
126126 '';
···185185 type = with types; nullOr str;
186186 default = if cfg.objstore.config == null then null
187187 else toString (toYAML "objstore.yaml" cfg.objstore.config);
188188- defaultText = ''
188188+ defaultText = literalExpression ''
189189 if config.services.thanos.<cmd>.objstore.config == null then null
190190 else toString (toYAML "objstore.yaml" config.services.thanos.<cmd>.objstore.config);
191191 '';
···227227 option = mkOption {
228228 type = types.str;
229229 default = "/var/lib/${config.services.prometheus.stateDir}/data";
230230- defaultText = "/var/lib/\${config.services.prometheus.stateDir}/data";
230230+ defaultText = literalExpression ''"/var/lib/''${config.services.prometheus.stateDir}/data"'';
231231 description = ''
232232 Data directory of TSDB.
233233 '';
···656656 package = mkOption {
657657 type = types.package;
658658 default = pkgs.thanos;
659659- defaultText = "pkgs.thanos";
659659+ defaultText = literalExpression "pkgs.thanos";
660660 description = ''
661661 The thanos package that should be used.
662662 '';
···8787 pass = mkOption {
8888 type = types.path;
8989 default = pkgs.writeText "unifi-poller-influxdb-default.password" "unifipoller";
9090- defaultText = "unifi-poller-influxdb-default.password";
9090+ defaultText = literalExpression "unifi-poller-influxdb-default.password";
9191 description = ''
9292 Path of a file containing the password for influxdb.
9393 This file needs to be readable by the unifi-poller user.
···130130 pass = mkOption {
131131 type = types.path;
132132 default = pkgs.writeText "unifi-poller-unifi-default.password" "unifi";
133133- defaultText = "unifi-poller-unifi-default.password";
133133+ defaultText = literalExpression "unifi-poller-unifi-default.password";
134134 description = ''
135135 Path of a file containing the password for the unifi service user.
136136 This file needs to be readable by the unifi-poller user.
···9797 mgrModulePath = mkOption {
9898 type = types.path;
9999 default = "${pkgs.ceph.lib}/lib/ceph/mgr";
100100+ defaultText = literalExpression ''"''${pkgs.ceph.lib}/lib/ceph/mgr"'';
100101 description = ''
101102 Path at which to find ceph-mgr modules.
102103 '';
···181182 rgwMimeTypesFile = mkOption {
182183 type = with types; nullOr path;
183184 default = "${pkgs.mime-types}/etc/mime.types";
185185+ defaultText = literalExpression ''"''${pkgs.mime-types}/etc/mime.types"'';
184186 description = ''
185187 Path to mime types used by radosgw.
186188 '';
···190192 extraConfig = mkOption {
191193 type = with types; attrsOf str;
192194 default = {};
193193- example = ''
194194- {
195195- "ms bind ipv6" = "true";
196196- };
197197- '';
195195+ example = {
196196+ "ms bind ipv6" = "true";
197197+ };
198198 description = ''
199199 Extra configuration to add to the global section. Use for setting values that are common for all daemons in the cluster.
200200 '';
···205205 daemons = mkOption {
206206 type = with types; listOf str;
207207 default = [];
208208- example = ''
209209- [ "name1" "name2" ];
210210- '';
208208+ example = [ "name1" "name2" ];
211209 description = ''
212210 A list of names for manager daemons that should have a service created. The names correspond
213211 to the id part in ceph i.e. [ "name1" ] would result in mgr.name1
···227225 daemons = mkOption {
228226 type = with types; listOf str;
229227 default = [];
230230- example = ''
231231- [ "name1" "name2" ];
232232- '';
228228+ example = [ "name1" "name2" ];
233229 description = ''
234230 A list of monitor daemons that should have a service created. The names correspond
235231 to the id part in ceph i.e. [ "name1" ] would result in mon.name1
···249245 daemons = mkOption {
250246 type = with types; listOf str;
251247 default = [];
252252- example = ''
253253- [ "name1" "name2" ];
254254- '';
248248+ example = [ "name1" "name2" ];
255249 description = ''
256250 A list of OSD daemons that should have a service created. The names correspond
257251 to the id part in ceph i.e. [ "name1" ] would result in osd.name1
···279273 daemons = mkOption {
280274 type = with types; listOf str;
281275 default = [];
282282- example = ''
283283- [ "name1" "name2" ];
284284- '';
276276+ example = [ "name1" "name2" ];
285277 description = ''
286278 A list of metadata service daemons that should have a service created. The names correspond
287279 to the id part in ceph i.e. [ "name1" ] would result in mds.name1
···301293 daemons = mkOption {
302294 type = with types; listOf str;
303295 default = [];
304304- example = ''
305305- [ "name1" "name2" ];
306306- '';
296296+ example = [ "name1" "name2" ];
307297 description = ''
308298 A list of rados gateway daemons that should have a service created. The names correspond
309299 to the id part in ceph i.e. [ "name1" ] would result in client.name1, radosgw daemons
···318308 extraConfig = mkOption {
319309 type = with types; attrsOf (attrsOf str);
320310 default = {};
321321- example = ''
311311+ example = literalExpression ''
322312 {
323313 # This would create a section for a radosgw daemon named node0 and related
324314 # configuration for it
···14141515 settings = mkOption {
1616 type = settingsFormat.type;
1717- example = literalExample ''
1717+ example = literalExpression ''
1818 {
1919 interfaces = [
2020 # eth0 is an upstream interface monitoring for IPv6 router advertisements.
···44444545 configFile = mkOption {
4646 type = types.path;
4747- example = literalExample "\"\${pkgs.corerad}/etc/corerad/corerad.toml\"";
4747+ example = literalExpression ''"''${pkgs.corerad}/etc/corerad/corerad.toml"'';
4848 description = "Path to CoreRAD TOML configuration file.";
4949 };
50505151 package = mkOption {
5252 default = pkgs.corerad;
5353- defaultText = literalExample "pkgs.corerad";
5353+ defaultText = literalExpression "pkgs.corerad";
5454 type = types.package;
5555 description = "CoreRAD package to use.";
5656 };
+2-2
nixos/modules/services/networking/coturn.nix
···6868 alt-listening-port = mkOption {
6969 type = types.int;
7070 default = cfg.listening-port + 1;
7171- defaultText = "listening-port + 1";
7171+ defaultText = literalExpression "listening-port + 1";
7272 description = ''
7373 Alternative listening port for UDP and TCP listeners;
7474 default (or zero) value means "listening port plus one".
···8383 alt-tls-listening-port = mkOption {
8484 type = types.int;
8585 default = cfg.tls-listening-port + 1;
8686- defaultText = "tls-listening-port + 1";
8686+ defaultText = literalExpression "tls-listening-port + 1";
8787 description = ''
8888 Alternative listening port for TLS and DTLS protocols.
8989 '';
+1-1
nixos/modules/services/networking/dnscache.nix
···6161 Table of {hostname: server} pairs to use as authoritative servers for hosts (and subhosts).
6262 If entry for @ is not specified predefined list of root servers is used.
6363 '';
6464- example = literalExample ''
6464+ example = literalExpression ''
6565 {
6666 "@" = ["8.8.8.8" "8.8.4.4"];
6767 "example.com" = ["192.168.100.100"];
···1313 Attrset that is converted and passed as TOML config file.
1414 For available params, see: <link xlink:href="https://github.com/DNSCrypt/dnscrypt-proxy/blob/${pkgs.dnscrypt-proxy2.version}/dnscrypt-proxy/example-dnscrypt-proxy.toml"/>
1515 '';
1616- example = literalExample ''
1616+ example = literalExpression ''
1717 {
1818 sources.public-resolvers = {
1919 urls = [ "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" ];
···29293030 upstreamDefaults = mkOption {
3131 description = ''
3232- Whether to base the config declared in <literal>services.dnscrypt-proxy2.settings</literal> on the upstream example config (<link xlink:href="https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/dnscrypt-proxy/example-dnscrypt-proxy.toml"/>)
3232+ Whether to base the config declared in <option>services.dnscrypt-proxy2.settings</option> on the upstream example config (<link xlink:href="https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/dnscrypt-proxy/example-dnscrypt-proxy.toml"/>)
33333434 Disable this if you want to declare your dnscrypt config from scratch.
3535 '';
···5656 ''}
5757 ${pkgs.remarshal}/bin/json2toml < config.json > $out
5858 '';
5959- defaultText = literalExample "TOML file generated from services.dnscrypt-proxy2.settings";
5959+ defaultText = literalDocBook "TOML file generated from <option>services.dnscrypt-proxy2.settings</option>";
6060 };
6161 };
6262
···1515 flags = mkOption {
1616 type = types.listOf types.str;
1717 default = [];
1818- example = literalExample [ "--server-address=9.9.9.9:53" ];
1818+ example = [ "--server-address=9.9.9.9:53" ];
1919 description = ''
2020 A list of command-line flags to pass to doh-proxy. For details on the
2121 available options, see <link xlink:href="https://github.com/jedisct1/doh-server#usage"/>.
+2-2
nixos/modules/services/networking/ejabberd.nix
···3232 package = mkOption {
3333 type = types.package;
3434 default = pkgs.ejabberd;
3535- defaultText = "pkgs.ejabberd";
3535+ defaultText = literalExpression "pkgs.ejabberd";
3636 description = "ejabberd server package to use";
3737 };
3838···7676 type = types.listOf types.path;
7777 default = [];
7878 description = "Configuration dumps that should be loaded on the first startup";
7979- example = literalExample "[ ./myejabberd.dump ]";
7979+ example = literalExpression "[ ./myejabberd.dump ]";
8080 };
81818282 imagemagick = mkOption {
+1
nixos/modules/services/networking/epmd.nix
···2020 package = mkOption {
2121 type = types.package;
2222 default = pkgs.erlang;
2323+ defaultText = literalExpression "pkgs.erlang";
2324 description = ''
2425 The Erlang package to use to get epmd binary. That way you can re-use
2526 an Erlang runtime that is already installed for other purposes.
···325325 package = mkOption {
326326 type = types.package;
327327 default = pkgs.iptables;
328328- defaultText = "pkgs.iptables";
329329- example = literalExample "pkgs.iptables-nftables-compat";
328328+ defaultText = literalExpression "pkgs.iptables";
329329+ example = literalExpression "pkgs.iptables-nftables-compat";
330330 description =
331331 ''
332332 The iptables package to use for running the firewall service."
···500500 extraPackages = mkOption {
501501 type = types.listOf types.package;
502502 default = [ ];
503503- example = literalExample "[ pkgs.ipset ]";
503503+ example = literalExpression "[ pkgs.ipset ]";
504504 description =
505505 ''
506506 Additional packages to be included in the environment of the system
+1-1
nixos/modules/services/networking/flannel.nix
···2020 description = "Package to use for flannel";
2121 type = types.package;
2222 default = pkgs.flannel;
2323- defaultText = "pkgs.flannel";
2323+ defaultText = literalExpression "pkgs.flannel";
2424 };
25252626 publicIp = mkOption {
···2121 as described at <link xlink:href="https://www.infradead.org/openconnect/hip.html" />
2222 '';
2323 default = null;
2424- example = literalExample "\${pkgs.openconnect}/libexec/openconnect/hipreport.sh";
2424+ example = literalExpression ''"''${pkgs.openconnect}/libexec/openconnect/hipreport.sh"'';
2525 type = types.nullOr types.path;
2626 };
2727 };
+2-2
nixos/modules/services/networking/gnunet.nix
···115115 package = mkOption {
116116 type = types.package;
117117 default = pkgs.gnunet;
118118- defaultText = "pkgs.gnunet";
118118+ defaultText = literalExpression "pkgs.gnunet";
119119 description = "Overridable attribute of the gnunet package to use.";
120120- example = literalExample "pkgs.gnunet_git";
120120+ example = literalExpression "pkgs.gnunet_git";
121121 };
122122123123 extraOptions = mkOption {
+1-1
nixos/modules/services/networking/gobgpd.nix
···1818 <link xlink:href="https://github.com/osrg/gobgp#documentation"/>
1919 for details on supported values.
2020 '';
2121- example = literalExample ''
2121+ example = literalExpression ''
2222 {
2323 global = {
2424 config = {
+1-1
nixos/modules/services/networking/hans.nix
···2727 where <replaceable>name</replaceable> is the name of the
2828 corresponding attribute name.
2929 '';
3030- example = literalExample ''
3030+ example = literalExpression ''
3131 {
3232 foo = {
3333 server = "192.0.2.1";
···1717 package = lib.mkOption {
1818 type = lib.types.package;
1919 default = pkgs.inspircd;
2020- defaultText = lib.literalExample "pkgs.inspircd";
2121- example = lib.literalExample "pkgs.inspircdMinimal";
2020+ defaultText = lib.literalExpression "pkgs.inspircd";
2121+ example = lib.literalExpression "pkgs.inspircdMinimal";
2222 description = ''
2323 The InspIRCd package to use. This is mainly useful
2424 to specify an overridden version of the
+1-1
nixos/modules/services/networking/iodine.nix
···3636 where <replaceable>name</replaceable> is the name of the
3737 corresponding attribute name.
3838 '';
3939- example = literalExample ''
3939+ example = literalExpression ''
4040 {
4141 foo = {
4242 server = "tunnel.mdomain.com";
···2525 package = mkOption {
2626 type = types.package;
2727 default = pkgs.miredo;
2828- defaultText = "pkgs.miredo";
2828+ defaultText = literalExpression "pkgs.miredo";
2929 description = ''
3030 The package to use for the miredo daemon's binary.
3131 '';
+2-5
nixos/modules/services/networking/morty.nix
···2323 type = types.bool;
2424 default = true;
2525 description = "Allow IPv6 HTTP requests?";
2626- defaultText = "Allow IPv6 HTTP requests.";
2726 };
28272928 key = mkOption {
···3332 HMAC url validation key (hexadecimal encoded).
3433 Leave blank to disable. Without validation key, anyone can
3534 submit proxy requests. Leave blank to disable.
3535+ Generate with <literal>printf %s somevalue | openssl dgst -sha1 -hmac somekey</literal>
3636 '';
3737- defaultText = "No HMAC url validation. Generate with echo -n somevalue | openssl dgst -sha1 -hmac somekey";
3837 };
39384039 timeout = mkOption {
4140 type = types.int;
4241 default = 2;
4342 description = "Request timeout in seconds.";
4444- defaultText = "A resource now gets 2 seconds to respond.";
4543 };
46444745 package = mkOption {
4846 type = types.package;
4947 default = pkgs.morty;
5050- defaultText = "pkgs.morty";
4848+ defaultText = literalExpression "pkgs.morty";
5149 description = "morty package to use.";
5250 };
5351···6159 type = types.str;
6260 default = "127.0.0.1";
6361 description = "The address on which the service listens";
6464- defaultText = "127.0.0.1 (localhost)";
6562 };
66636764 };
-2
nixos/modules/services/networking/mosquitto.nix
···56565757 port = mkOption {
5858 default = 1883;
5959- example = 1883;
6059 type = types.int;
6160 description = ''
6261 Port on which to listen without SSL.
···95949695 port = mkOption {
9796 default = 8883;
9898- example = 8883;
9997 type = types.int;
10098 description = ''
10199 Port on which to listen with SSL.
+1-1
nixos/modules/services/networking/murmur.nix
···112112 package = mkOption {
113113 type = types.package;
114114 default = pkgs.murmur;
115115- defaultText = "pkgs.murmur";
115115+ defaultText = literalExpression "pkgs.murmur";
116116 description = "Overridable attribute of the murmur package to use.";
117117 };
118118
···247247 loopbackIPs = mkOption {
248248 type = types.listOf types.str;
249249 default = [];
250250- example = literalExample ''[ "55.1.2.3" ]'';
250250+ example = literalExpression ''[ "55.1.2.3" ]'';
251251 description = "Public IPs for NAT reflection; for connections to `loopbackip:sourcePort' from the host itself and from other hosts behind NAT";
252252 };
253253 };
+1-2
nixos/modules/services/networking/nats.nix
···43434444 port = mkOption {
4545 default = 4222;
4646- example = 4222;
4746 type = types.port;
4847 description = ''
4948 Port on which to listen.
···6766 settings = mkOption {
6867 default = { };
6968 type = format.type;
7070- example = literalExample ''
6969+ example = literalExpression ''
7170 {
7271 jetstream = {
7372 max_mem = "1G";
···142142 messages, and respond to them according to a set of rules.
143143 '';
144144 default = {};
145145- example = literalExample ''
145145+ example = literalExpression ''
146146 {
147147 eth0.rules."1111::/64" = {};
148148 }
+6-8
nixos/modules/services/networking/nebula.nix
···3030 package = mkOption {
3131 type = types.package;
3232 default = pkgs.nebula;
3333- defaultText = "pkgs.nebula";
3333+ defaultText = literalExpression "pkgs.nebula";
3434 description = "Nebula derivation to use.";
3535 };
3636···5959 The static host map defines a set of hosts with fixed IP addresses on the internet (or any network).
6060 A host can have multiple fixed IP addresses defined here, and nebula will try each when establishing a tunnel.
6161 '';
6262- example = literalExample ''
6363- { "192.168.100.1" = [ "100.64.22.11:4242" ]; }
6464- '';
6262+ example = { "192.168.100.1" = [ "100.64.22.11:4242" ]; };
6563 };
66646765 isLighthouse = mkOption {
···7775 List of IPs of lighthouse hosts this node should report to and query from. This should be empty on lighthouse
7876 nodes. The IPs should be the lighthouse's Nebula IPs, not their external IPs.
7977 '';
8080- example = ''[ "192.168.100.1" ]'';
7878+ example = [ "192.168.100.1" ];
8179 };
82808381 listen.host = mkOption {
···110108 type = types.listOf types.attrs;
111109 default = [];
112110 description = "Firewall rules for outbound traffic.";
113113- example = ''[ { port = "any"; proto = "any"; host = "any"; } ]'';
111111+ example = [ { port = "any"; proto = "any"; host = "any"; } ];
114112 };
115113116114 firewall.inbound = mkOption {
117115 type = types.listOf types.attrs;
118116 default = [];
119117 description = "Firewall rules for inbound traffic.";
120120- example = ''[ { port = "any"; proto = "any"; host = "any"; } ]'';
118118+ example = [ { port = "any"; proto = "any"; host = "any"; } ];
121119 };
122120123121 settings = mkOption {
···128126 <link xlink:href="https://github.com/slackhq/nebula/blob/master/examples/config.yml"/>
129127 for details on supported values.
130128 '';
131131- example = literalExample ''
129129+ example = literalExpression ''
132130 {
133131 lighthouse.dns = {
134132 host = "0.0.0.0";
···3232 };
3333 networking.nftables.ruleset = mkOption {
3434 type = types.lines;
3535+ default = "";
3536 example = ''
3637 # Check out https://wiki.nftables.org/ for better documentation.
3738 # Table for both IPv4 and IPv6.
···8687 name = "nftables-rules";
8788 text = cfg.ruleset;
8889 };
9090+ defaultText = literalDocBook ''a file with the contents of <option>networking.nftables.ruleset</option>'';
8991 description =
9092 ''
9193 The ruleset file to be used with nftables. Should be in a format that
···1313 package = mkOption {
1414 type = types.package;
1515 default = pkgs.nomad;
1616- defaultText = "pkgs.nomad";
1616+ defaultText = literalExpression "pkgs.nomad";
1717 description = ''
1818 The package used for the Nomad agent and CLI.
1919 '';
···2525 description = ''
2626 Extra packages to add to <envar>PATH</envar> for the Nomad agent process.
2727 '';
2828- example = literalExample ''
2828+ example = literalExpression ''
2929 with pkgs; [ cni-plugins ]
3030 '';
3131 };
···5555 description = ''
5656 Additional settings paths used to configure nomad. These can be files or directories.
5757 '';
5858- example = literalExample ''
5858+ example = literalExpression ''
5959 [ "/etc/nomad-mutable.json" "/run/keys/nomad-with-secrets.json" "/etc/nomad/config.d" ]
6060 '';
6161 };
···8181 the <literal>DynamicUser</literal> feature of systemd which directly
8282 manages and operates on <literal>StateDirectory</literal>.
8383 '';
8484- example = literalExample ''
8484+ example = literalExpression ''
8585 {
8686 # A minimal config example:
8787 server = {
+2-4
nixos/modules/services/networking/nsd.nix
···260260 data = mkOption {
261261 type = types.lines;
262262 default = "";
263263- example = "";
264263 description = ''
265264 The actual zone data. This is the content of your zone file.
266265 Use imports or pkgs.lib.readFile if you don't want this data in your config file.
···397396 requestXFR = mkOption {
398397 type = types.listOf types.str;
399398 default = [];
400400- example = [];
401399 description = ''
402400 Format: <code>[AXFR|UDP] <ip-address> <key-name | NOKEY></code>
403401 '';
···726724 };
727725 });
728726 default = {};
729729- example = literalExample ''
727727+ example = literalExpression ''
730728 { "tsig.example.org" = {
731729 algorithm = "hmac-md5";
732730 keyFile = "/path/to/my/key";
···861859 zones = mkOption {
862860 type = types.attrsOf zoneOptions;
863861 default = {};
864864- example = literalExample ''
862862+ example = literalExpression ''
865863 { "serverGroup1" = {
866864 provideXFR = [ "10.1.2.3 NOKEY" ];
867865 children = {
···8484 services.openvpn.servers = mkOption {
8585 default = {};
86868787- example = literalExample ''
8787+ example = literalExpression ''
8888 {
8989 server = {
9090 config = '''
+2-2
nixos/modules/services/networking/ostinato.nix
···6565 include = mkOption {
6666 type = types.listOf types.str;
6767 default = [];
6868- example = ''[ "eth*" "lo*" ]'';
6868+ example = [ "eth*" "lo*" ];
6969 description = ''
7070 For a port to pass the filter and appear on the port list managed
7171 by drone, it be allowed by this include list.
···7474 exclude = mkOption {
7575 type = types.listOf types.str;
7676 default = [];
7777- example = ''[ "usbmon*" "eth0" ]'';
7777+ example = [ "usbmon*" "eth0" ];
7878 description = ''
7979 A list of ports does not appear on the port list managed by drone.
8080 '';
···3030 package = mkOption {
3131 type = types.package;
3232 default = pkgs.spacecookie;
3333- defaultText = literalExample "pkgs.spacecookie";
3434- example = literalExample "pkgs.haskellPackages.spacecookie";
3333+ defaultText = literalExpression "pkgs.spacecookie";
3434+ example = literalExpression "pkgs.haskellPackages.spacecookie";
3535 description = ''
3636 The spacecookie derivation to use. This can be used to
3737 override the used package or to use another version.
···6969 CAFile = mkOption {
7070 type = types.nullOr types.path;
7171 default = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
7272+ defaultText = literalExpression ''"''${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"'';
7273 description = "Path to a file containing certificates to validate against.";
7374 };
7475
+2-2
nixos/modules/services/networking/supplicant.nix
···7373 path = mkOption {
7474 type = types.nullOr types.path;
7575 default = null;
7676- example = literalExample "/etc/wpa_supplicant.conf";
7676+ example = literalExpression "/etc/wpa_supplicant.conf";
7777 description = ''
7878 External <literal>wpa_supplicant.conf</literal> configuration file.
7979 The configuration options defined declaratively within <literal>networking.supplicant</literal> have
···170170171171 default = { };
172172173173- example = literalExample ''
173173+ example = literalExpression ''
174174 { "wlan0 wlan1" = {
175175 configFile.path = "/etc/wpa_supplicant.conf";
176176 userControlled.group = "network";
+4-3
nixos/modules/services/networking/supybot.nix
···2424 default = if versionAtLeast config.system.stateVersion "20.09"
2525 then "/var/lib/supybot"
2626 else "/home/supybot";
2727- defaultText = "/var/lib/supybot";
2727+ defaultText = literalExpression "/var/lib/supybot";
2828 description = "The root directory, logs and plugins are stored here";
2929 };
3030···4949 Please note that you still need to add the plugins to the config
5050 file (or with <literal>!load</literal>) using their attribute name.
5151 '';
5252- example = literalExample ''
5252+ example = literalExpression ''
5353 let
5454 plugins = pkgs.fetchzip {
5555 url = "https://github.com/ProgVal/Supybot-plugins/archive/57c2450c.zip";
···6666 extraPackages = mkOption {
6767 type = types.functionTo (types.listOf types.package);
6868 default = p: [];
6969+ defaultText = literalExpression "p: []";
6970 description = ''
7071 Extra Python packages available to supybot plugins. The
7172 value must be a function which receives the attrset defined
7273 in <varname>python3Packages</varname> as the sole argument.
7374 '';
7474- example = literalExample "p: [ p.lxml p.requests ]";
7575+ example = literalExpression "p: [ p.lxml p.requests ]";
7576 };
76777778 };
+5-5
nixos/modules/services/networking/syncthing.nix
···182182 will be reverted on restart if <link linkend="opt-services.syncthing.overrideDevices">overrideDevices</link>
183183 is enabled.
184184 '';
185185- example = literalExample ''
185185+ example = literalExpression ''
186186 {
187187 "/home/user/sync" = {
188188 id = "syncme";
···243243 There are 4 different types of versioning with different parameters.
244244 See <link xlink:href="https://docs.syncthing.net/users/versioning.html"/>.
245245 '';
246246- example = literalExample ''
246246+ example = literalExpression ''
247247 [
248248 {
249249 versioning = {
···430430 description = ''
431431 The path where the settings and keys will exist.
432432 '';
433433- default = cfg.dataDir + (optionalString cond "/.config/syncthing");
434434- defaultText = literalExample "dataDir${optionalString cond " + \"/.config/syncthing\""}";
433433+ default = cfg.dataDir + optionalString cond "/.config/syncthing";
434434+ defaultText = literalExpression "dataDir${optionalString cond " + \"/.config/syncthing\""}";
435435 };
436436437437 extraFlags = mkOption {
···461461 package = mkOption {
462462 type = types.package;
463463 default = pkgs.syncthing;
464464- defaultText = literalExample "pkgs.syncthing";
464464+ defaultText = literalExpression "pkgs.syncthing";
465465 description = ''
466466 The Syncthing package to use.
467467 '';
+1-1
nixos/modules/services/networking/tailscale.nix
···2424 package = mkOption {
2525 type = types.package;
2626 default = pkgs.tailscale;
2727- defaultText = "pkgs.tailscale";
2727+ defaultText = literalExpression "pkgs.tailscale";
2828 description = "The package to use for tailscale";
2929 };
3030 };
+1-1
nixos/modules/services/networking/tedicross.nix
···1818 config = mkOption {
1919 type = types.attrs;
2020 # from https://github.com/TediCross/TediCross/blob/master/example.settings.yaml
2121- example = literalExample ''
2121+ example = literalExpression ''
2222 {
2323 telegram = {
2424 useFirstNameInsteadOfUsername = false;
+1-1
nixos/modules/services/networking/thelounge.nix
···3232 extraConfig = mkOption {
3333 default = {};
3434 type = types.attrs;
3535- example = literalExample ''{
3535+ example = literalExpression ''{
3636 reverseProxy = true;
3737 defaults = {
3838 name = "Your Network";
+3-3
nixos/modules/services/networking/tinc.nix
···226226227227 hostSettings = mkOption {
228228 default = { };
229229- example = literalExample ''
229229+ example = literalExpression ''
230230 {
231231 host1 = {
232232 addresses = [
···282282 package = mkOption {
283283 type = types.package;
284284 default = pkgs.tinc_pre;
285285- defaultText = "pkgs.tinc_pre";
285285+ defaultText = literalExpression "pkgs.tinc_pre";
286286 description = ''
287287 The package to use for the tinc daemon's binary.
288288 '';
···302302 settings = mkOption {
303303 default = { };
304304 type = types.submodule { freeformType = tincConfType; };
305305- example = literalExample ''
305305+ example = literalExpression ''
306306 {
307307 Interface = "custom.interface";
308308 DirectOnly = true;
+1-1
nixos/modules/services/networking/toxvpn.nix
···2222 auto_add_peers = mkOption {
2323 type = types.listOf types.str;
2424 default = [];
2525- example = ''[ "toxid1" "toxid2" ]'';
2525+ example = [ "toxid1" "toxid2" ];
2626 description = "peers to automatically connect to on startup";
2727 };
2828 };
+1-1
nixos/modules/services/networking/trickster.nix
···2020 package = mkOption {
2121 type = types.package;
2222 default = pkgs.trickster;
2323- defaultText = "pkgs.trickster";
2323+ defaultText = literalExpression "pkgs.trickster";
2424 description = ''
2525 Package that should be used for trickster.
2626 '';
+5-5
nixos/modules/services/networking/ucarp.nix
···9191 Command to run after become master, the interface name, virtual address
9292 and optional extra parameters are passed as arguments.
9393 '';
9494- example = ''
9494+ example = literalExpression ''
9595 pkgs.writeScript "upscript" '''
9696 #!/bin/sh
9797- $\{pkgs.iproute2\}/bin/ip addr add "$2"/24 dev "$1"
9797+ ''${pkgs.iproute2}/bin/ip addr add "$2"/24 dev "$1"
9898 ''';
9999 '';
100100 };
···105105 Command to run after become backup, the interface name, virtual address
106106 and optional extra parameters are passed as arguments.
107107 '';
108108- example = ''
108108+ example = literalExpression ''
109109 pkgs.writeScript "downscript" '''
110110 #!/bin/sh
111111- $\{pkgs.iproute2\}/bin/ip addr del "$2"/24 dev "$1"
111111+ ''${pkgs.iproute2}/bin/ip addr del "$2"/24 dev "$1"
112112 ''';
113113 '';
114114 };
···152152 upstream updates for a long time and can be considered as unmaintained.
153153 '';
154154 default = pkgs.ucarp;
155155- defaultText = "pkgs.ucarp";
155155+ defaultText = literalExpression "pkgs.ucarp";
156156 };
157157 };
158158
+2-2
nixos/modules/services/networking/unbound.nix
···4545 package = mkOption {
4646 type = types.package;
4747 default = pkgs.unbound-with-systemd;
4848- defaultText = "pkgs.unbound-with-systemd";
4848+ defaultText = literalExpression "pkgs.unbound-with-systemd";
4949 description = "The unbound package to use";
5050 };
5151···128128 };
129129 };
130130 };
131131- example = literalExample ''
131131+ example = literalExpression ''
132132 {
133133 server = {
134134 interface = [ "127.0.0.1" ];
+3-3
nixos/modules/services/networking/unifi.nix
···4444 services.unifi.jrePackage = mkOption {
4545 type = types.package;
4646 default = pkgs.jre8;
4747- defaultText = "pkgs.jre8";
4747+ defaultText = literalExpression "pkgs.jre8";
4848 description = ''
4949 The JRE package to use. Check the release notes to ensure it is supported.
5050 '';
···5353 services.unifi.unifiPackage = mkOption {
5454 type = types.package;
5555 default = pkgs.unifiLTS;
5656- defaultText = "pkgs.unifiLTS";
5656+ defaultText = literalExpression "pkgs.unifiLTS";
5757 description = ''
5858 The unifi package to use.
5959 '';
···6262 services.unifi.mongodbPackage = mkOption {
6363 type = types.package;
6464 default = pkgs.mongodb;
6565- defaultText = "pkgs.mongodb";
6565+ defaultText = literalExpression "pkgs.mongodb";
6666 description = ''
6767 The mongodb package to use.
6868 '';
+1-1
nixos/modules/services/networking/vsftpd.nix
···159159 userlistFile = mkOption {
160160 type = types.path;
161161 default = pkgs.writeText "userlist" (concatMapStrings (x: "${x}\n") cfg.userlist);
162162- defaultText = "pkgs.writeText \"userlist\" (concatMapStrings (x: \"\${x}\n\") cfg.userlist)";
162162+ defaultText = literalExpression ''pkgs.writeText "userlist" (concatMapStrings (x: "''${x}\n") cfg.userlist)'';
163163 description = ''
164164 Newline separated list of names to be allowed/denied if <option>userlistEnable</option>
165165 is <literal>true</literal>. Meaning see <option>userlistDeny</option>.
···328328 description = ''
329329 Set this to <literal>true</literal> if the SSID of the network is hidden.
330330 '';
331331- example = literalExample ''
331331+ example = literalExpression ''
332332 { echelon = {
333333 hidden = true;
334334 psk = "abcdefgh";
···377377 /etc/wpa_supplicant.conf as the configuration file.
378378 '';
379379 default = {};
380380- example = literalExample ''
380380+ example = literalExpression ''
381381 { echelon = { # SSID with no spaces or special characters
382382 psk = "abcdefgh"; # (password will be written to /nix/store!)
383383 };
···4040 package = mkOption {
4141 type = types.package;
4242 default = pkgs.certmgr;
4343- defaultText = "pkgs.certmgr";
4343+ defaultText = literalExpression "pkgs.certmgr";
4444 description = "Which certmgr package to use in the service.";
4545 };
4646···76767777 specs = mkOption {
7878 default = {};
7979- example = literalExample ''
7979+ example = literalExpression ''
8080 {
8181 exampleCert =
8282 let
+2-2
nixos/modules/services/security/cfssl.nix
···2727 };
28282929 ca = mkOption {
3030- defaultText = "\${cfg.dataDir}/ca.pem";
3030+ defaultText = literalExpression ''"''${cfg.dataDir}/ca.pem"'';
3131 type = types.str;
3232 description = "CA used to sign the new certificate -- accepts '[file:]fname' or 'env:varname'.";
3333 };
34343535 caKey = mkOption {
3636- defaultText = "file:\${cfg.dataDir}/ca-key.pem";
3636+ defaultText = literalExpression ''"file:''${cfg.dataDir}/ca-key.pem"'';
3737 type = types.str;
3838 description = "CA private key -- accepts '[file:]fname' or 'env:varname'.";
3939 };
+6-4
nixos/modules/services/security/fail2ban.nix
···55555656 package = mkOption {
5757 default = pkgs.fail2ban;
5858+ defaultText = literalExpression "pkgs.fail2ban";
5859 type = types.package;
5959- example = "pkgs.fail2ban_0_11";
6060+ example = literalExpression "pkgs.fail2ban_0_11";
6061 description = "The fail2ban package to use for running the fail2ban service.";
6162 };
62636364 packageFirewall = mkOption {
6465 default = pkgs.iptables;
6666+ defaultText = literalExpression "pkgs.iptables";
6567 type = types.package;
6666- example = "pkgs.nftables";
6868+ example = literalExpression "pkgs.nftables";
6769 description = "The firewall package used by fail2ban service.";
6870 };
69717072 extraPackages = mkOption {
7173 default = [];
7274 type = types.listOf types.package;
7373- example = lib.literalExample "[ pkgs.ipset ]";
7575+ example = lib.literalExpression "[ pkgs.ipset ]";
7476 description = ''
7577 Extra packages to be made available to the fail2ban service. The example contains
7678 the packages needed by the `iptables-ipset-proto6` action.
···202204203205 jails = mkOption {
204206 default = { };
205205- example = literalExample ''
207207+ example = literalExpression ''
206208 { apache-nohome-iptables = '''
207209 # Block an IP address if it accesses a non-existent
208210 # home directory more than 5 times in 10 minutes,
+2-2
nixos/modules/services/security/fprintd.nix
···2323 package = mkOption {
2424 type = types.package;
2525 default = fprintdPkg;
2626- defaultText = "if cfg.tod.enable then pkgs.fprintd-tod else pkgs.fprintd";
2626+ defaultText = literalExpression "if config.services.fprintd.tod.enable then pkgs.fprintd-tod else pkgs.fprintd";
2727 description = ''
2828 fprintd package to use.
2929 '';
···35353636 driver = mkOption {
3737 type = types.package;
3838- example = literalExample "pkgs.libfprint-2-tod1-goodix";
3838+ example = literalExpression "pkgs.libfprint-2-tod1-goodix";
3939 description = ''
4040 Touch OEM Drivers (TOD) package to use.
4141 '';
···4444 package = mkOption {
4545 type = types.package;
4646 default = pkgs.usbguard;
4747- defaultText = "pkgs.usbguard";
4747+ defaultText = literalExpression "pkgs.usbguard";
4848 description = ''
4949 The usbguard package to use. If you do not need the Qt GUI, use
5050 <literal>pkgs.usbguard-nox</literal> to save disk space.
···5050 config = mkOption {
5151 type = types.attrs;
5252 default = {};
5353- example = literalExample ''
5353+ example = literalExpression ''
5454 {
5555 download_location = "/srv/torrents/";
5656 max_upload_speed = "1000.0";
···149149150150 package = mkOption {
151151 type = types.package;
152152- example = literalExample "pkgs.deluge-2_x";
152152+ example = literalExpression "pkgs.deluge-2_x";
153153 description = ''
154154 Deluge package to use.
155155 '';
+1-1
nixos/modules/services/torrent/flexget.nix
···39394040 systemScheduler = mkOption {
4141 default = true;
4242- example = "false";
4242+ example = false;
4343 type = types.bool;
4444 description = "When true, execute the runs via the flexget-runner.timer. If false, you have to specify the settings yourself in the YML file.";
4545 };
···3333 apply = p: p.override {
3434 plugins = lib.unique (p.enabledPlugins ++ cfg.plugins);
3535 };
3636- defaultText = "pkgs.discourse";
3636+ defaultText = lib.literalExpression "pkgs.discourse";
3737 description = ''
3838 The discourse package to use.
3939 '';
···4545 config.networking.fqdn
4646 else
4747 config.networking.hostName;
4848- defaultText = "config.networking.fqdn";
4848+ defaultText = lib.literalExpression "config.networking.fqdn";
4949 example = "discourse.example.com";
5050 description = ''
5151 The hostname to serve Discourse on.
···9999 enableACME = lib.mkOption {
100100 type = lib.types.bool;
101101 default = cfg.sslCertificate == null && cfg.sslCertificateKey == null;
102102- defaultText = "true, unless services.discourse.sslCertificate and services.discourse.sslCertificateKey are set.";
102102+ defaultText = lib.literalDocBook ''
103103+ <literal>true</literal>, unless <option>services.discourse.sslCertificate</option>
104104+ and <option>services.discourse.sslCertificateKey</option> are set.
105105+ '';
103106 description = ''
104107 Whether an ACME certificate should be used to secure
105108 connections to the server.
···109112 backendSettings = lib.mkOption {
110113 type = with lib.types; attrsOf (nullOr (oneOf [ str int bool float ]));
111114 default = {};
112112- example = lib.literalExample ''
115115+ example = lib.literalExpression ''
113116 {
114117 max_reqs_per_ip_per_minute = 300;
115118 max_reqs_per_ip_per_10_seconds = 60;
···134137 siteSettings = lib.mkOption {
135138 type = json.type;
136139 default = {};
137137- example = lib.literalExample ''
140140+ example = lib.literalExpression ''
138141 {
139142 required = {
140143 title = "My Cats";
···334337 notificationEmailAddress = lib.mkOption {
335338 type = lib.types.str;
336339 default = "${if cfg.mail.incoming.enable then "notifications" else "noreply"}@${cfg.hostname}";
337337- defaultText = ''
338338- "notifications@`config.services.discourse.hostname`" if
339339- config.services.discourse.mail.incoming.enable is "true",
340340- otherwise "noreply`config.services.discourse.hostname`"
340340+ defaultText = lib.literalExpression ''
341341+ "''${if config.services.discourse.mail.incoming.enable then "notifications" else "noreply"}@''${config.services.discourse.hostname}"
341342 '';
342343 description = ''
343344 The <literal>from:</literal> email address used when
···448449 replyEmailAddress = lib.mkOption {
449450 type = lib.types.str;
450451 default = "%{reply_key}@${cfg.hostname}";
451451- defaultText = "%{reply_key}@`config.services.discourse.hostname`";
452452+ defaultText = lib.literalExpression ''"%{reply_key}@''${config.services.discourse.hostname}"'';
452453 description = ''
453454 Template for reply by email incoming email address, for
454455 example: %{reply_key}@reply.example.com or
···459460 mailReceiverPackage = lib.mkOption {
460461 type = lib.types.package;
461462 default = pkgs.discourse-mail-receiver;
462462- defaultText = "pkgs.discourse-mail-receiver";
463463+ defaultText = lib.literalExpression "pkgs.discourse-mail-receiver";
463464 description = ''
464465 The discourse-mail-receiver package to use.
465466 '';
···484485 plugins = lib.mkOption {
485486 type = lib.types.listOf lib.types.package;
486487 default = [];
487487- example = lib.literalExample ''
488488+ example = lib.literalExpression ''
488489 with config.services.discourse.package.plugins; [
489490 discourse-canned-replies
490491 discourse-github
+1
nixos/modules/services/web-apps/documize.nix
···2626 package = mkOption {
2727 type = types.package;
2828 default = pkgs.documize-community;
2929+ defaultText = literalExpression "pkgs.documize-community";
2930 description = ''
3031 Which package to use for documize.
3132 '';
+33-32
nixos/modules/services/web-apps/dokuwiki.nix
···2233let
44 inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption types maintainers recursiveUpdate;
55- inherit (lib) any attrValues concatMapStrings concatMapStringsSep flatten literalExample;
55+ inherit (lib) any attrValues concatMapStrings concatMapStringsSep flatten literalExpression;
66 inherit (lib) filterAttrs mapAttrs mapAttrs' mapAttrsToList nameValuePair optional optionalAttrs optionalString;
7788 cfg = migrateOldAttrs config.services.dokuwiki;
···6969 package = mkOption {
7070 type = types.package;
7171 default = pkgs.dokuwiki;
7272+ defaultText = literalExpression "pkgs.dokuwiki";
7273 description = "Which DokuWiki package to use.";
7374 };
7475···167168 List of path(s) to respective plugin(s) which are copied from the 'plugin' directory.
168169 <note><para>These plugins need to be packaged before use, see example.</para></note>
169170 '';
170170- example = ''
171171- # Let's package the icalevents plugin
172172- plugin-icalevents = pkgs.stdenv.mkDerivation {
173173- name = "icalevents";
174174- # Download the plugin from the dokuwiki site
175175- src = pkgs.fetchurl {
176176- url = "https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip";
177177- sha256 = "e40ed7dd6bbe7fe3363bbbecb4de481d5e42385b5a0f62f6a6ce6bf3a1f9dfa8";
171171+ example = literalExpression ''
172172+ let
173173+ # Let's package the icalevents plugin
174174+ plugin-icalevents = pkgs.stdenv.mkDerivation {
175175+ name = "icalevents";
176176+ # Download the plugin from the dokuwiki site
177177+ src = pkgs.fetchurl {
178178+ url = "https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip";
179179+ sha256 = "e40ed7dd6bbe7fe3363bbbecb4de481d5e42385b5a0f62f6a6ce6bf3a1f9dfa8";
180180+ };
181181+ sourceRoot = ".";
182182+ # We need unzip to build this package
183183+ buildInputs = [ pkgs.unzip ];
184184+ # Installing simply means copying all files to the output directory
185185+ installPhase = "mkdir -p $out; cp -R * $out/";
178186 };
179179- sourceRoot = ".";
180180- # We need unzip to build this package
181181- buildInputs = [ pkgs.unzip ];
182182- # Installing simply means copying all files to the output directory
183183- installPhase = "mkdir -p $out; cp -R * $out/";
184184- };
185185-186187 # And then pass this theme to the plugin list like this:
187187- plugins = [ plugin-icalevents ];
188188+ in [ plugin-icalevents ]
188189 '';
189190 };
190191···195196 List of path(s) to respective template(s) which are copied from the 'tpl' directory.
196197 <note><para>These templates need to be packaged before use, see example.</para></note>
197198 '';
198198- example = ''
199199- # Let's package the bootstrap3 theme
200200- template-bootstrap3 = pkgs.stdenv.mkDerivation {
201201- name = "bootstrap3";
202202- # Download the theme from the dokuwiki site
203203- src = pkgs.fetchurl {
204204- url = "https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip";
205205- sha256 = "4de5ff31d54dd61bbccaf092c9e74c1af3a4c53e07aa59f60457a8f00cfb23a6";
199199+ example = literalExpression ''
200200+ let
201201+ # Let's package the bootstrap3 theme
202202+ template-bootstrap3 = pkgs.stdenv.mkDerivation {
203203+ name = "bootstrap3";
204204+ # Download the theme from the dokuwiki site
205205+ src = pkgs.fetchurl {
206206+ url = "https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip";
207207+ sha256 = "4de5ff31d54dd61bbccaf092c9e74c1af3a4c53e07aa59f60457a8f00cfb23a6";
208208+ };
209209+ # We need unzip to build this package
210210+ buildInputs = [ pkgs.unzip ];
211211+ # Installing simply means copying all files to the output directory
212212+ installPhase = "mkdir -p $out; cp -R * $out/";
206213 };
207207- # We need unzip to build this package
208208- buildInputs = [ pkgs.unzip ];
209209- # Installing simply means copying all files to the output directory
210210- installPhase = "mkdir -p $out; cp -R * $out/";
211211- };
212212-213214 # And then pass this theme to the template list like this:
214214- templates = [ template-bootstrap3 ];
215215+ in [ template-bootstrap3 ]
215216 '';
216217 };
217218
···7373 port = mkOption {
7474 type = types.int;
7575 default = 3000;
7676- example = "80";
7676+ example = 80;
7777 description = ''
7878 Port to listen on.
7979 '';
···135135 csp = mkOption {
136136 type = types.nullOr types.attrs;
137137 default = null;
138138- example = literalExample ''
138138+ example = literalExpression ''
139139 {
140140 enable = true;
141141 directives = {
···222222 db = mkOption {
223223 type = types.attrs;
224224 default = {};
225225- example = literalExample ''
225225+ example = literalExpression ''
226226 {
227227 dialect = "sqlite";
228228 storage = "/var/lib/${name}/db.${name}.sqlite";
···313313 errorPath = mkOption {
314314 type = types.nullOr types.str;
315315 default = null;
316316- defaultText = "./public/views/error.ejs";
316316+ defaultText = literalExpression "./public/views/error.ejs";
317317 description = ''
318318 Path to the error template file.
319319 (Non-canonical paths are relative to HedgeDoc's base directory)
···322322 prettyPath = mkOption {
323323 type = types.nullOr types.str;
324324 default = null;
325325- defaultText = "./public/views/pretty.ejs";
325325+ defaultText = literalExpression "./public/views/pretty.ejs";
326326 description = ''
327327 Path to the pretty template file.
328328 (Non-canonical paths are relative to HedgeDoc's base directory)
···331331 slidePath = mkOption {
332332 type = types.nullOr types.str;
333333 default = null;
334334- defaultText = "./public/views/slide.hbs";
334334+ defaultText = literalExpression "./public/views/slide.hbs";
335335 description = ''
336336 Path to the slide template file.
337337 (Non-canonical paths are relative to HedgeDoc's base directory)
···340340 uploadsPath = mkOption {
341341 type = types.str;
342342 default = "${cfg.workDir}/uploads";
343343- defaultText = "/var/lib/${name}/uploads";
343343+ defaultText = literalExpression "/var/lib/${name}/uploads";
344344 description = ''
345345 Path under which uploaded files are saved.
346346 '';
···925925 package = mkOption {
926926 type = types.package;
927927 default = pkgs.hedgedoc;
928928+ defaultText = literalExpression "pkgs.hedgedoc";
928929 description = ''
929930 Package that provides HedgeDoc.
930931 '';
+1-1
nixos/modules/services/web-apps/hledger-web.nix
···2020 port = mkOption {
2121 type = types.port;
2222 default = 5000;
2323- example = "80";
2323+ example = 80;
2424 description = ''
2525 Port to listen on.
2626 '';
···2233let
44 inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption types;
55- inherit (lib) concatStringsSep literalExample mapAttrsToList optional optionalString;
55+ inherit (lib) concatStringsSep literalExpression mapAttrsToList optional optionalString;
6677 cfg = config.services.moodle;
88 fpm = config.services.phpfpm.pools.moodle;
···6767 package = mkOption {
6868 type = types.package;
6969 default = pkgs.moodle;
7070- defaultText = "pkgs.moodle";
7070+ defaultText = literalExpression "pkgs.moodle";
7171 description = "The Moodle package to use.";
7272 };
7373···100100 mysql = 3306;
101101 pgsql = 5432;
102102 }.${cfg.database.type};
103103- defaultText = "3306";
103103+ defaultText = literalExpression "3306";
104104 };
105105106106 name = mkOption {
···131131 if mysqlLocal then "/run/mysqld/mysqld.sock"
132132 else if pgsqlLocal then "/run/postgresql"
133133 else null;
134134- defaultText = "/run/mysqld/mysqld.sock";
134134+ defaultText = literalExpression "/run/mysqld/mysqld.sock";
135135 description = "Path to the unix socket file to use for authentication.";
136136 };
137137···144144145145 virtualHost = mkOption {
146146 type = types.submodule (import ../web-servers/apache-httpd/vhost-options.nix);
147147- example = literalExample ''
147147+ example = literalExpression ''
148148 {
149149 hostName = "moodle.example.org";
150150 adminAddr = "webmaster@example.org";
+2-2
nixos/modules/services/web-apps/nextcloud.nix
···134134 phpExtraExtensions = mkOption {
135135 type = with types; functionTo (listOf package);
136136 default = all: [];
137137- defaultText = "all: []";
137137+ defaultText = literalExpression "all: []";
138138 description = ''
139139 Additional PHP extensions to use for nextcloud.
140140 By default, only extensions necessary for a vanilla nextcloud installation are enabled,
141141 but you may choose from the list of available extensions and add further ones.
142142 This is sometimes necessary to be able to install a certain nextcloud app that has additional requirements.
143143 '';
144144- example = literalExample ''
144144+ example = literalExpression ''
145145 all: [ all.pdlib all.bz2 ]
146146 '';
147147 };
···3030 dataDir = mkOption {
3131 type = types.path;
3232 default = "/var/lib/restya-board";
3333- example = "/var/lib/restya-board";
3433 description = ''
3534 Data of the application.
3635 '';
···3938 user = mkOption {
4039 type = types.str;
4140 default = "restya-board";
4242- example = "restya-board";
4341 description = ''
4442 User account under which the web-application runs.
4543 '';
···4846 group = mkOption {
4947 type = types.str;
5048 default = "nginx";
5151- example = "nginx";
5249 description = ''
5350 Group account under which the web-application runs.
5451 '';
+1-3
nixos/modules/services/web-apps/rss-bridge.nix
···1616 user = mkOption {
1717 type = types.str;
1818 default = "nginx";
1919- example = "nginx";
2019 description = ''
2120 User account under which both the service and the web-application run.
2221 '';
···2524 group = mkOption {
2625 type = types.str;
2726 default = "nginx";
2828- example = "nginx";
2927 description = ''
3028 Group under which the web-application run.
3129 '';
···6159 whitelist = mkOption {
6260 type = types.listOf types.str;
6361 default = [];
6464- example = options.literalExample ''
6262+ example = options.literalExpression ''
6563 [
6664 "Facebook"
6765 "Instagram"
-1
nixos/modules/services/web-apps/selfoss.nix
···3535 user = mkOption {
3636 type = types.str;
3737 default = "nginx";
3838- example = "nginx";
3938 description = ''
4039 User account under which both the service and the web-application run.
4140 '';
···126126 root = mkOption {
127127 type = types.path;
128128 default = "/var/lib/tt-rss";
129129- example = "/var/lib/tt-rss";
130129 description = ''
131130 Root of the application.
132131 '';
···135134 user = mkOption {
136135 type = types.str;
137136 default = "tt_rss";
138138- example = "tt_rss";
139137 description = ''
140138 User account under which both the update daemon and the web-application run.
141139 '';
···2233let
44 inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption types;
55- inherit (lib) any attrValues concatMapStringsSep flatten literalExample;
55+ inherit (lib) any attrValues concatMapStringsSep flatten literalExpression;
66 inherit (lib) filterAttrs mapAttrs mapAttrs' mapAttrsToList nameValuePair optional optionalAttrs optionalString;
7788 cfg = migrateOldAttrs config.services.wordpress;
···8787 package = mkOption {
8888 type = types.package;
8989 default = pkgs.wordpress;
9090+ defaultText = literalExpression "pkgs.wordpress";
9091 description = "Which WordPress package to use.";
9192 };
9293···106107 List of path(s) to respective plugin(s) which are copied from the 'plugins' directory.
107108 <note><para>These plugins need to be packaged before use, see example.</para></note>
108109 '';
109109- example = ''
110110- # Wordpress plugin 'embed-pdf-viewer' installation example
111111- embedPdfViewerPlugin = pkgs.stdenv.mkDerivation {
112112- name = "embed-pdf-viewer-plugin";
113113- # Download the theme from the wordpress site
114114- src = pkgs.fetchurl {
115115- url = "https://downloads.wordpress.org/plugin/embed-pdf-viewer.2.0.3.zip";
116116- sha256 = "1rhba5h5fjlhy8p05zf0p14c9iagfh96y91r36ni0rmk6y891lyd";
110110+ example = literalExpression ''
111111+ let
112112+ # Wordpress plugin 'embed-pdf-viewer' installation example
113113+ embedPdfViewerPlugin = pkgs.stdenv.mkDerivation {
114114+ name = "embed-pdf-viewer-plugin";
115115+ # Download the theme from the wordpress site
116116+ src = pkgs.fetchurl {
117117+ url = "https://downloads.wordpress.org/plugin/embed-pdf-viewer.2.0.3.zip";
118118+ sha256 = "1rhba5h5fjlhy8p05zf0p14c9iagfh96y91r36ni0rmk6y891lyd";
119119+ };
120120+ # We need unzip to build this package
121121+ nativeBuildInputs = [ pkgs.unzip ];
122122+ # Installing simply means copying all files to the output directory
123123+ installPhase = "mkdir -p $out; cp -R * $out/";
117124 };
118118- # We need unzip to build this package
119119- nativeBuildInputs = [ pkgs.unzip ];
120120- # Installing simply means copying all files to the output directory
121121- installPhase = "mkdir -p $out; cp -R * $out/";
122122- };
123123-124124- And then pass this theme to the themes list like this:
125125- plugins = [ embedPdfViewerPlugin ];
125125+ # And then pass this theme to the themes list like this:
126126+ in [ embedPdfViewerPlugin ]
126127 '';
127128 };
128129···133134 List of path(s) to respective theme(s) which are copied from the 'theme' directory.
134135 <note><para>These themes need to be packaged before use, see example.</para></note>
135136 '';
136136- example = ''
137137- # Let's package the responsive theme
138138- responsiveTheme = pkgs.stdenv.mkDerivation {
139139- name = "responsive-theme";
140140- # Download the theme from the wordpress site
141141- src = pkgs.fetchurl {
142142- url = "https://downloads.wordpress.org/theme/responsive.3.14.zip";
143143- sha256 = "0rjwm811f4aa4q43r77zxlpklyb85q08f9c8ns2akcarrvj5ydx3";
137137+ example = literalExpression ''
138138+ let
139139+ # Let's package the responsive theme
140140+ responsiveTheme = pkgs.stdenv.mkDerivation {
141141+ name = "responsive-theme";
142142+ # Download the theme from the wordpress site
143143+ src = pkgs.fetchurl {
144144+ url = "https://downloads.wordpress.org/theme/responsive.3.14.zip";
145145+ sha256 = "0rjwm811f4aa4q43r77zxlpklyb85q08f9c8ns2akcarrvj5ydx3";
146146+ };
147147+ # We need unzip to build this package
148148+ nativeBuildInputs = [ pkgs.unzip ];
149149+ # Installing simply means copying all files to the output directory
150150+ installPhase = "mkdir -p $out; cp -R * $out/";
144151 };
145145- # We need unzip to build this package
146146- nativeBuildInputs = [ pkgs.unzip ];
147147- # Installing simply means copying all files to the output directory
148148- installPhase = "mkdir -p $out; cp -R * $out/";
149149- };
150150-151151- And then pass this theme to the themes list like this:
152152- themes = [ responsiveTheme ];
152152+ # And then pass this theme to the themes list like this:
153153+ in [ responsiveTheme ]
153154 '';
154155 };
155156···204205 socket = mkOption {
205206 type = types.nullOr types.path;
206207 default = null;
207207- defaultText = "/run/mysqld/mysqld.sock";
208208+ defaultText = literalExpression "/run/mysqld/mysqld.sock";
208209 description = "Path to the unix socket file to use for authentication.";
209210 };
210211···217218218219 virtualHost = mkOption {
219220 type = types.submodule (import ../web-servers/apache-httpd/vhost-options.nix);
220220- example = literalExample ''
221221+ example = literalExpression ''
221222 {
222223 adminAddr = "webmaster@example.org";
223224 forceSSL = true;
+2-2
nixos/modules/services/web-apps/youtrack.nix
···4646 https://www.jetbrains.com/help/youtrack/standalone/YouTrack-Java-Start-Parameters.html
4747 for more information.
4848 '';
4949- example = literalExample ''
4949+ example = literalExpression ''
5050 {
5151 "jetbrains.youtrack.overrideRootPassword" = "tortuga";
5252 }
···6060 '';
6161 type = types.package;
6262 default = pkgs.youtrack;
6363- defaultText = "pkgs.youtrack";
6363+ defaultText = literalExpression "pkgs.youtrack";
6464 };
65656666 port = mkOption {
···22222323 hostName = mkOption {
2424 type = types.str;
2525- example = literalExample "config.networking.hostName";
2625 default = config.networking.hostName;
2626+ defaultText = literalExpression "config.networking.hostName";
2727 description = ''
2828 The hostname to respond to requests for. Requests for URLs with
2929 other hosts will result in a status 53 (PROXY REQUEST REFUSED)
···5050 defaultWwwUri = mkOption {
5151 type = types.str;
5252 default = "${pkgs.surf-display}/share/surf-display/empty-page.html";
5353+ defaultText = literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"'';
5354 example = "https://www.example.com/";
5455 description = "Default URI to display.";
5556 };
···5758 inactivityInterval = mkOption {
5859 type = types.int;
5960 default = 300;
6060- example = "0";
6161+ example = 0;
6162 description = ''
6263 Setting for internal inactivity timer to restart surf-display if the
6364 user goes inactive/idle to get a fresh session for the next user of
···4949 thunarPlugins = mkOption {
5050 default = [];
5151 type = types.listOf types.package;
5252- example = literalExample "[ pkgs.xfce.thunar-archive-plugin ]";
5252+ example = literalExpression "[ pkgs.xfce.thunar-archive-plugin ]";
5353 description = ''
5454 A list of plugin that should be installed with Thunar.
5555 '';
···148148 background = mkOption {
149149 type = types.path;
150150 # Manual cannot depend on packages, we are actually setting the default in config below.
151151- defaultText = "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath";
151151+ defaultText = literalExpression "pkgs.nixos-artwork.wallpapers.simple-dark-gray-bottom.gnomeFilePath";
152152 description = ''
153153 The background image or color to use.
154154 '';
···2727 default = [];
2828 type = types.listOf types.package;
2929 description = "List of lua packages available for being used in the Awesome configuration.";
3030- example = literalExample "[ pkgs.luaPackages.vicious ]";
3030+ example = literalExpression "[ pkgs.luaPackages.vicious ]";
3131 };
32323333 package = mkOption {
···155155156156 specialisation = mkOption {
157157 default = {};
158158- example = lib.literalExample "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";
158158+ example = lib.literalExpression "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";
159159 description = ''
160160 Additional configurations to build. If
161161 <literal>inheritParentConfig</literal> is true, the system
···243243244244 system.replaceRuntimeDependencies = mkOption {
245245 default = [];
246246- example = lib.literalExample "[ ({ original = pkgs.openssl; replacement = pkgs.callPackage /path/to/openssl { }; }) ]";
246246+ example = lib.literalExpression "[ ({ original = pkgs.openssl; replacement = pkgs.callPackage /path/to/openssl { }; }) ]";
247247 type = types.listOf (types.submodule (
248248 { ... }: {
249249 options.original = mkOption {
···274274 if config.networking.hostName == ""
275275 then "unnamed"
276276 else config.networking.hostName;
277277- defaultText = '''networking.hostName' if non empty else "unnamed"'';
277277+ defaultText = literalExpression ''
278278+ if config.networking.hostName == ""
279279+ then "unnamed"
280280+ else config.networking.hostName;
281281+ '';
278282 description = ''
279283 The name of the system used in the <option>system.build.toplevel</option> derivation.
280284 </para><para>
+1-1
nixos/modules/system/boot/initrd-openvpn.nix
···3535 </para>
3636 </warning>
3737 '';
3838- example = "./configuration.ovpn";
3838+ example = literalExpression "./configuration.ovpn";
3939 };
40404141 };
+1-1
nixos/modules/system/boot/initrd-ssh.nix
···7878 authorizedKeys = mkOption {
7979 type = types.listOf types.str;
8080 default = config.users.users.root.openssh.authorizedKeys.keys;
8181- defaultText = "config.users.users.root.openssh.authorizedKeys.keys";
8181+ defaultText = literalExpression "config.users.users.root.openssh.authorizedKeys.keys";
8282 description = ''
8383 Authorized keys for the root user on initrd.
8484 '';
+6-6
nixos/modules/system/boot/kernel.nix
···23232424 boot.kernel.features = mkOption {
2525 default = {};
2626- example = literalExample "{ debug = true; }";
2626+ example = literalExpression "{ debug = true; }";
2727 internal = true;
2828 description = ''
2929 This option allows to enable or disable certain kernel features.
···4646 });
4747 # We don't want to evaluate all of linuxPackages for the manual
4848 # - some of it might not even evaluate correctly.
4949- defaultText = "pkgs.linuxPackages";
5050- example = literalExample "pkgs.linuxKernel.packages.linux_5_10";
4949+ defaultText = literalExpression "pkgs.linuxPackages";
5050+ example = literalExpression "pkgs.linuxKernel.packages.linux_5_10";
5151 description = ''
5252 This option allows you to override the Linux kernel used by
5353 NixOS. Since things like external kernel module packages are
···6565 boot.kernelPatches = mkOption {
6666 type = types.listOf types.attrs;
6767 default = [];
6868- example = literalExample "[ pkgs.kernelPatches.ubuntu_fan_4_4 ]";
6868+ example = literalExpression "[ pkgs.kernelPatches.ubuntu_fan_4_4 ]";
6969 description = "A list of additional patches to apply to the kernel.";
7070 };
7171···113113 boot.extraModulePackages = mkOption {
114114 type = types.listOf types.package;
115115 default = [];
116116- example = literalExample "[ config.boot.kernelPackages.nvidia_x11 ]";
116116+ example = literalExpression "[ config.boot.kernelPackages.nvidia_x11 ]";
117117 description = "A list of additional packages supplying kernel modules.";
118118 };
119119···181181182182 system.requiredKernelConfig = mkOption {
183183 default = [];
184184- example = literalExample ''
184184+ example = literalExpression ''
185185 with config.lib.kernelConfig; [
186186 (isYes "MODULES")
187187 (isEnabled "FB_CON_DECOR")
+1-1
nixos/modules/system/boot/kernel_config.nix
···100100101101 settings = mkOption {
102102 type = types.attrsOf kernelItem;
103103- example = literalExample '' with lib.kernel; {
103103+ example = literalExpression '' with lib.kernel; {
104104 "9P_NET" = yes;
105105 USB = option yes;
106106 MMC_BLOCK_MINORS = freeform "32";
+6-6
nixos/modules/system/boot/loader/grub/grub.nix
···329329330330 extraInstallCommands = mkOption {
331331 default = "";
332332- example = literalExample ''
332332+ example = ''
333333 # the example below generates detached signatures that GRUB can verify
334334 # https://www.gnu.org/software/grub/manual/grub/grub.html#Using-digital-signatures
335335 ''${pkgs.findutils}/bin/find /boot -not -path "/boot/efi/*" -type f -name '*.sig' -delete
···392392 extraFiles = mkOption {
393393 type = types.attrsOf types.path;
394394 default = {};
395395- example = literalExample ''
395395+ example = literalExpression ''
396396 { "memtest.bin" = "''${pkgs.memtest86plus}/memtest.bin"; }
397397 '';
398398 description = ''
···413413414414 splashImage = mkOption {
415415 type = types.nullOr types.path;
416416- example = literalExample "./my-background.png";
416416+ example = literalExpression "./my-background.png";
417417 description = ''
418418 Background image used for GRUB.
419419 Set to <literal>null</literal> to run GRUB in text mode.
···449449450450 theme = mkOption {
451451 type = types.nullOr types.path;
452452- example = literalExample "pkgs.nixos-grub2-theme";
452452+ example = literalExpression "pkgs.nixos-grub2-theme";
453453 default = null;
454454 description = ''
455455 Grub theme to be used.
···475475 font = mkOption {
476476 type = types.nullOr types.path;
477477 default = "${realGrub}/share/grub/unicode.pf2";
478478- defaultText = ''"''${pkgs.grub2}/share/grub/unicode.pf2"'';
478478+ defaultText = literalExpression ''"''${pkgs.grub2}/share/grub/unicode.pf2"'';
479479 description = ''
480480 Path to a TrueType, OpenType, or pf2 font to be used by Grub.
481481 '';
···483483484484 fontSize = mkOption {
485485 type = types.nullOr types.int;
486486- example = literalExample 16;
486486+ example = 16;
487487 default = null;
488488 description = ''
489489 Font size for the grub menu. Ignored unless <literal>font</literal>
+1-1
nixos/modules/system/boot/loader/grub/ipxe.nix
···3333 booting from the GRUB boot menu.
3434 '';
3535 default = { };
3636- example = literalExample ''
3636+ example = literalExpression ''
3737 { demo = '''
3838 #!ipxe
3939 dhcp
-2
nixos/modules/system/boot/luksroot.nix
···663663 };
664664665665 encryptedPass = mkOption {
666666- default = "";
667666 type = types.path;
668667 description = "Path to the GPG encrypted passphrase.";
669668 };
670669671670 publicKey = mkOption {
672672- default = "";
673671 type = types.path;
674672 description = "Path to the Public Key.";
675673 };
+4-8
nixos/modules/system/boot/networkd.nix
···844844 options = {
845845 wireguardPeerConfig = mkOption {
846846 default = {};
847847- example = { };
848847 type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionWireGuardPeer;
849848 description = ''
850849 Each attribute in this set specifies an option in the
···859858 netdevOptions = commonNetworkOptions // {
860859861860 netdevConfig = mkOption {
862862- default = {};
863861 example = { Name = "mybridge"; Kind = "bridge"; };
864862 type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionNetdev;
865863 description = ''
···896894897895 vxlanConfig = mkOption {
898896 default = {};
899899- example = { Id = "4"; };
900897 type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionVXLAN;
901898 description = ''
902899 Each attribute in this set specifies an option in the
···959956 example = {
960957 PrivateKeyFile = "/etc/wireguard/secret.key";
961958 ListenPort = 51820;
962962- FwMark = 42;
959959+ FirewallMark = 42;
963960 };
964961 type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionWireGuard;
965962 description = ''
···10381035 addressOptions = {
10391036 options = {
10401037 addressConfig = mkOption {
10411041- default = {};
10421038 example = { Address = "192.168.0.100/24"; };
10431039 type = types.addCheck (types.attrsOf unitOption) check.network.sectionAddress;
10441040 description = ''
···10551051 options = {
10561052 routingPolicyRuleConfig = mkOption {
10571053 default = { };
10581058- example = { routingPolicyRuleConfig = { Table = 10; IncomingInterface = "eth1"; Family = "both"; } ;};
10541054+ example = { Table = 10; IncomingInterface = "eth1"; Family = "both"; };
10591055 type = types.addCheck (types.attrsOf unitOption) check.network.sectionRoutingPolicyRule;
10601056 description = ''
10611057 Each attribute in this set specifies an option in the
···1146114211471143 dhcpV6Config = mkOption {
11481144 default = {};
11491149- example = { UseDNS = true; UseRoutes = true; };
11451145+ example = { UseDNS = true; };
11501146 type = types.addCheck (types.attrsOf unitOption) check.network.sectionDHCPv6;
11511147 description = ''
11521148 Each attribute in this set specifies an option in the
···1213120912141210 ipv6Prefixes = mkOption {
12151211 default = [];
12161216- example = { AddressAutoconfiguration = true; OnLink = true; };
12121212+ example = [ { AddressAutoconfiguration = true; OnLink = true; } ];
12171213 type = with types; listOf (submodule ipv6PrefixOptions);
12181214 description = ''
12191215 A list of ipv6Prefix sections to be added to the unit. See
+2-1
nixos/modules/system/boot/plymouth.nix
···62626363 font = mkOption {
6464 default = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf";
6565+ defaultText = literalExpression ''"''${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf"'';
6566 type = types.path;
6667 description = ''
6768 Font file made available for displaying text on the splash screen.
···8889 type = types.path;
8990 # Dimensions are 48x48 to match GDM logo
9091 default = "${nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png";
9191- defaultText = ''pkgs.fetchurl {
9292+ defaultText = literalExpression ''pkgs.fetchurl {
9293 url = "https://nixos.org/logo/nixos-hires.png";
9394 sha256 = "1ivzgd7iz0i06y36p8m5w48fd8pjqwxhdaavc0pxs7w1g7mcy5si";
9495 }'';
+3-3
nixos/modules/system/boot/stage-1.nix
···411411 boot.initrd.enable = mkOption {
412412 type = types.bool;
413413 default = !config.boot.isContainer;
414414- defaultText = "!config.boot.isContainer";
414414+ defaultText = literalExpression "!config.boot.isContainer";
415415 description = ''
416416 Whether to enable the NixOS initial RAM disk (initrd). This may be
417417 needed to perform some initialisation tasks (like mounting
···527527 then "zstd"
528528 else "gzip"
529529 );
530530- defaultText = "zstd if the kernel supports it (5.9+), gzip if not.";
530530+ defaultText = literalDocBook "<literal>zstd</literal> if the kernel supports it (5.9+), <literal>gzip</literal> if not";
531531 type = types.unspecified; # We don't have a function type...
532532 description = ''
533533 The compressor to use on the initrd image. May be any of:
···559559 is the path it should be copied from (or null for the same
560560 path inside and out).
561561 '';
562562- example = literalExample
562562+ example = literalExpression
563563 ''
564564 { "/etc/dropbear/dropbear_rsa_host_key" =
565565 ./secret-dropbear-key;
···3535 <link xlink:href="https://linux.die.net/man/5/idmapd.conf"/>
3636 for details.
3737 '';
3838- example = literalExample ''
3838+ example = literalExpression ''
3939 {
4040 Translation = {
4141 GSS-Methods = "static,nsswitch";
+2-3
nixos/modules/tasks/filesystems/zfs.nix
···104104 readOnly = true;
105105 type = types.package;
106106 default = if config.boot.zfs.enableUnstable then pkgs.zfsUnstable else pkgs.zfs;
107107- defaultText = "if config.boot.zfs.enableUnstable then pkgs.zfsUnstable else pkgs.zfs";
107107+ defaultText = literalExpression "if config.boot.zfs.enableUnstable then pkgs.zfsUnstable else pkgs.zfs";
108108 description = "Configured ZFS userland tools package.";
109109 };
110110···150150 devNodes = mkOption {
151151 type = types.path;
152152 default = "/dev/disk/by-id";
153153- example = "/dev/disk/by-id";
154153 description = ''
155154 Name of directory from which to import ZFS devices.
156155···351350352351 settings = mkOption {
353352 type = with types; attrsOf (oneOf [ str int bool (listOf str) ]);
354354- example = literalExample ''
353353+ example = literalExpression ''
355354 {
356355 ZED_DEBUG_LOG = "/tmp/zed.debug.log";
357356
+1-1
nixos/modules/tasks/lvm.nix
···99 type = types.package;
1010 default = if cfg.dmeventd.enable then pkgs.lvm2_dmeventd else pkgs.lvm2;
1111 internal = true;
1212- defaultText = "pkgs.lvm2";
1212+ defaultText = literalExpression "pkgs.lvm2";
1313 description = ''
1414 This option allows you to override the LVM package that's used on the system
1515 (udev rules, tmpfiles, systemd services).
+9-10
nixos/modules/tasks/network-interfaces.nix
···146146 tempAddress = mkOption {
147147 type = types.enum (lib.attrNames tempaddrValues);
148148 default = cfg.tempAddresses;
149149- defaultText = literalExample ''config.networking.tempAddresses'';
149149+ defaultText = literalExpression ''config.networking.tempAddresses'';
150150 description = ''
151151 When IPv6 is enabled with SLAAC, this option controls the use of
152152 temporary address (aka privacy extensions) on this
···257257258258 virtualType = mkOption {
259259 default = if hasPrefix "tun" name then "tun" else "tap";
260260- defaultText = literalExample ''if hasPrefix "tun" name then "tun" else "tap"'';
260260+ defaultText = literalExpression ''if hasPrefix "tun" name then "tun" else "tap"'';
261261 type = with types; enum [ "tun" "tap" ];
262262 description = ''
263263 The type of interface to create.
···420420 The FQDN is required but cannot be determined. Please make sure that
421421 both networking.hostName and networking.domain are set properly.
422422 '';
423423- defaultText = literalExample ''''${networking.hostName}.''${networking.domain}'';
423423+ defaultText = literalExpression ''"''${networking.hostName}.''${networking.domain}"'';
424424 description = ''
425425 The fully qualified domain name (FQDN) of this host. It is the result
426426 of combining networking.hostName and networking.domain. Using this
···578578 options = {
579579580580 interfaces = mkOption {
581581- example = [ "eth0" "eth1" ];
582581 description = "The physical network interfaces connected by the vSwitch.";
583582 type = with types; attrsOf (submodule vswitchInterfaceOpts);
584583 };
···691690 '';
692691 in mkOption {
693692 default = { };
694694- example = literalExample ''
693693+ example = literalExpression ''
695694 {
696695 bond0 = {
697696 interfaces = [ "eth0" "wlan0" ];
···720719 driverOptions = mkOption {
721720 type = types.attrsOf types.str;
722721 default = {};
723723- example = literalExample driverOptionsExample;
722722+ example = literalExpression driverOptionsExample;
724723 description = ''
725724 Options for the bonding driver.
726725 Documentation can be found in
···784783785784 networking.macvlans = mkOption {
786785 default = { };
787787- example = literalExample ''
786786+ example = literalExpression ''
788787 {
789788 wan = {
790789 interface = "enp2s0";
···819818820819 networking.sits = mkOption {
821820 default = { };
822822- example = literalExample ''
821821+ example = literalExpression ''
823822 {
824823 hurricane = {
825824 remote = "10.0.0.1";
···883882884883 networking.vlans = mkOption {
885884 default = { };
886886- example = literalExample ''
885885+ example = literalExpression ''
887886 {
888887 vlan0 = {
889888 id = 3;
···927926928927 networking.wlanInterfaces = mkOption {
929928 default = { };
930930- example = literalExample ''
929929+ example = literalExpression ''
931930 {
932931 wlan-station0 = {
933932 device = "wlp6s0";
+1-1
nixos/modules/virtualisation/anbox.nix
···35353636 image = mkOption {
3737 default = pkgs.anbox.image;
3838- example = literalExample "pkgs.anbox.image";
3838+ defaultText = literalExpression "pkgs.anbox.image";
3939 type = types.package;
4040 description = ''
4141 Base android image for Anbox.
···5050 package = mkOption {
5151 type = types.package;
5252 default = pkgs.libvirt;
5353- defaultText = "pkgs.libvirt";
5353+ defaultText = literalExpression "pkgs.libvirt";
5454 description = ''
5555 libvirt package to use.
5656 '';
···5959 qemuPackage = mkOption {
6060 type = types.package;
6161 default = pkgs.qemu;
6262+ defaultText = literalExpression "pkgs.qemu";
6263 description = ''
6364 Qemu package to use with libvirt.
6465 `pkgs.qemu` can emulate alien architectures (e.g. aarch64 on x86)
+3-3
nixos/modules/virtualisation/lxd.nix
···3535 package = mkOption {
3636 type = types.package;
3737 default = pkgs.lxd.override { nftablesSupport = config.networking.nftables.enable; };
3838- defaultText = "pkgs.lxd";
3838+ defaultText = literalExpression "pkgs.lxd";
3939 description = ''
4040 The LXD package to use.
4141 '';
···4444 lxcPackage = mkOption {
4545 type = types.package;
4646 default = pkgs.lxc;
4747- defaultText = "pkgs.lxc";
4747+ defaultText = literalExpression "pkgs.lxc";
4848 description = ''
4949 The LXC package to use with LXD (required for AppArmor profiles).
5050 '';
···5353 zfsSupport = mkOption {
5454 type = types.bool;
5555 default = config.boot.zfs.enabled;
5656- defaultText = "config.boot.zfs.enabled";
5656+ defaultText = literalExpression "config.boot.zfs.enabled";
5757 description = ''
5858 Enables lxd to use zfs as a storage for containers.
5959
+3-3
nixos/modules/virtualisation/nixos-containers.nix
···530530 nixpkgs = mkOption {
531531 type = types.path;
532532 default = pkgs.path;
533533- defaultText = "pkgs.path";
533533+ defaultText = literalExpression "pkgs.path";
534534 description = ''
535535 A path to the nixpkgs that provide the modules, pkgs and lib for evaluating the container.
536536···636636 bindMounts = mkOption {
637637 type = with types; attrsOf (submodule bindMountOpts);
638638 default = {};
639639- example = literalExample ''
639639+ example = literalExpression ''
640640 { "/home" = { hostPath = "/home/alice";
641641 isReadOnly = false; };
642642 }
···707707 }));
708708709709 default = {};
710710- example = literalExample
710710+ example = literalExpression
711711 ''
712712 { webserver =
713713 { path = "/nix/var/nix/profiles/webserver";
+8-8
nixos/modules/virtualisation/oci-containers.nix
···2828 You still need to set the <literal>image</literal> attribute, as it
2929 will be used as the image name for docker to start a container.
3030 '';
3131- example = literalExample "pkgs.dockerTools.buildDockerImage {...};";
3131+ example = literalExpression "pkgs.dockerTools.buildDockerImage {...};";
3232 };
33333434 login = {
···5959 type = with types; listOf str;
6060 default = [];
6161 description = "Commandline arguments to pass to the image's entrypoint.";
6262- example = literalExample ''
6262+ example = literalExpression ''
6363 ["--port=9000"]
6464 '';
6565 };
···7575 type = with types; attrsOf str;
7676 default = {};
7777 description = "Environment variables to set for this container.";
7878- example = literalExample ''
7878+ example = literalExpression ''
7979 {
8080 DATABASE_HOST = "db.example.com";
8181 DATABASE_PORT = "3306";
···8787 type = with types; listOf path;
8888 default = [];
8989 description = "Environment files for this container.";
9090- example = literalExample ''
9090+ example = literalExpression ''
9191 [
9292 /path/to/.env
9393 /path/to/.env.secret
···160160 <link xlink:href="https://docs.docker.com/engine/reference/run/#expose-incoming-ports">
161161 Docker engine documentation</link> for full details.
162162 '';
163163- example = literalExample ''
163163+ example = literalExpression ''
164164 [
165165 "8080:9000"
166166 ]
···191191 <link xlink:href="https://docs.docker.com/engine/reference/run/#volume-shared-filesystems">
192192 docker engine documentation</link> for details.
193193 '';
194194- example = literalExample ''
194194+ example = literalExpression ''
195195 [
196196 "volume_name:/path/inside/container"
197197 "/path/on/host:/path/inside/container"
···214214215215 Use the same name as the attribute under <literal>virtualisation.oci-containers.containers</literal>.
216216 '';
217217- example = literalExample ''
217217+ example = literalExpression ''
218218 virtualisation.oci-containers.containers = {
219219 node1 = {};
220220 node2 = {
···228228 type = with types; listOf str;
229229 default = [];
230230 description = "Extra options for <command>${defaultBackend} run</command>.";
231231- example = literalExample ''
231231+ example = literalExpression ''
232232 ["--network=host"]
233233 '';
234234 };
···455455 };
456456 });
457457 default = [];
458458- example = lib.literalExample
458458+ example = lib.literalExpression
459459 ''
460460 [ # forward local port 2222 -> 22, to ssh into the VM
461461 { from = "host"; host.port = 2222; guest.port = 22; }
+3-4
nixos/modules/virtualisation/railcar.nix
···4141 description = "Source for the in-container mount";
4242 };
4343 options = mkOption {
4444- type = attrsOf (str);
4444+ type = listOf str;
4545 default = [ "bind" ];
4646 description = ''
4747 Mount options of the filesystem to be used.
···7777 The defaults have been chosen for simple bindmounts, meaning
7878 that you only need to provide the "source" parameter.
7979 '';
8080- example = ''
8181- { "/data" = { source = "/var/lib/data"; }; }
8282- '';
8080+ example = { "/data" = { source = "/var/lib/data"; }; };
8381 };
84828583 runType = mkOption {
···112110 package = mkOption {
113111 type = types.package;
114112 default = pkgs.railcar;
113113+ defaultText = literalExpression "pkgs.railcar";
115114 description = "Railcar package to use";
116115 };
117116 };