nixos/manual: Use literalExample when feasible.

Should bring most of the examples into a better consistency regarding
syntactic representation in the manual.

Thanks to @devhell for reporting.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>

aszlig 8a56a55b 9667a406

Changed files
+39 -27
nixos
modules
config
installer
misc
services
audio
backup
logging
monitoring
networking
ircd-hybrid
web-servers
apache-httpd
x11
desktop-managers
display-managers
+1 -1
nixos/modules/config/fonts/fonts.nix
···
# TODO: find another name for it.
fonts = mkOption {
type = types.listOf types.path;
-
example = [ pkgs.dejavu_fonts ];
description = "List of primary font paths.";
apply = list: list ++
[ # - the user's current profile
···
# TODO: find another name for it.
fonts = mkOption {
type = types.listOf types.path;
+
example = literalExample "[ pkgs.dejavu_fonts ]";
description = "List of primary font paths.";
apply = list: list ++
[ # - the user's current profile
+6 -2
nixos/modules/config/power-management.nix
···
powerUpCommands = mkOption {
type = types.lines;
default = "";
-
example = "${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda";
description =
''
Commands executed when the machine powers up. That is,
···
powerDownCommands = mkOption {
type = types.lines;
default = "";
-
example = "${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda";
description =
''
Commands executed when the machine powers down. That is,
···
powerUpCommands = mkOption {
type = types.lines;
default = "";
+
example = literalExample ''
+
"''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"
+
'';
description =
''
Commands executed when the machine powers up. That is,
···
powerDownCommands = mkOption {
type = types.lines;
default = "";
+
example = literalExample ''
+
"''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"
+
'';
description =
''
Commands executed when the machine powers down. That is,
+1 -1
nixos/modules/config/pulseaudio.nix
···
package = mkOption {
type = types.package;
default = pulseaudioFull;
-
example = literalExample "pulseaudioFull";
description = ''
The PulseAudio derivation to use. This can be used to disable
features (such as JACK support, Bluetooth) that are enabled in the
···
package = mkOption {
type = types.package;
default = pulseaudioFull;
+
example = literalExample "pkgs.pulseaudioFull";
description = ''
The PulseAudio derivation to use. This can be used to disable
features (such as JACK support, Bluetooth) that are enabled in the
+3 -1
nixos/modules/config/shells-environment.nix
···
environment.binsh = mkOption {
default = "${config.system.build.binsh}/bin/sh";
-
example = "\${pkgs.dash}/bin/dash";
type = types.path;
description = ''
The shell executable that is linked system-wide to
···
environment.binsh = mkOption {
default = "${config.system.build.binsh}/bin/sh";
+
example = literalExample ''
+
"''${pkgs.dash}/bin/dash"
+
'';
type = types.path;
description = ''
The shell executable that is linked system-wide to
+4 -3
nixos/modules/installer/cd-dvd/iso-image.nix
···
};
isoImage.contents = mkOption {
-
example =
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}
-
];
description = ''
This option lists files to be copied to fixed locations in the
generated ISO image.
···
};
isoImage.storeContents = mkOption {
-
example = [pkgs.stdenv];
description = ''
This option lists additional derivations to be included in the
Nix store in the generated ISO image.
···
};
isoImage.contents = mkOption {
+
example = literalExample ''
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}
+
]
+
'';
description = ''
This option lists files to be copied to fixed locations in the
generated ISO image.
···
};
isoImage.storeContents = mkOption {
+
example = literalExample "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated ISO image.
+4 -3
nixos/modules/installer/cd-dvd/system-tarball.nix
···
{
options = {
tarball.contents = mkOption {
-
example =
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}
-
];
description = ''
This option lists files to be copied to fixed locations in the
generated ISO image.
···
};
tarball.storeContents = mkOption {
-
example = [pkgs.stdenv];
description = ''
This option lists additional derivations to be included in the
Nix store in the generated ISO image.
···
{
options = {
tarball.contents = mkOption {
+
example = literalExample ''
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}
+
]
+
'';
description = ''
This option lists files to be copied to fixed locations in the
generated ISO image.
···
};
tarball.storeContents = mkOption {
+
example = literalExample "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated ISO image.
+1 -1
nixos/modules/misc/crashdump.nix
···
# We don't want to evaluate all of linuxPackages for the manual
# - some of it might not even evaluate correctly.
defaultText = "pkgs.linuxPackages";
-
example = "pkgs.linuxPackages_2_6_25";
description = ''
This will override the boot.kernelPackages, and will add some
kernel configuration parameters for the crash dump to work.
···
# We don't want to evaluate all of linuxPackages for the manual
# - some of it might not even evaluate correctly.
defaultText = "pkgs.linuxPackages";
+
example = literalExample "pkgs.linuxPackages_2_6_25";
description = ''
This will override the boot.kernelPackages, and will add some
kernel configuration parameters for the crash dump to work.
+1 -1
nixos/modules/services/audio/mopidy.nix
···
extensionPackages = mkOption {
default = [];
type = types.listOf types.package;
-
example = [ mopidy-spotify ];
description = ''
Mopidy extensions that should be loaded by the service.
'';
···
extensionPackages = mkOption {
default = [];
type = types.listOf types.package;
+
example = literalExample "[ pkgs.mopidy-spotify ]";
description = ''
Mopidy extensions that should be loaded by the service.
'';
+1 -1
nixos/modules/services/backup/rsnapshot.nix
···
cronIntervals = mkOption {
default = {};
-
example = { "hourly" = "0 * * * *"; "daily" = "50 21 * * *"; };
type = types.attrsOf types.string;
description = ''
Periodicity at which intervals should be run by cron.
···
cronIntervals = mkOption {
default = {};
+
example = { hourly = "0 * * * *"; daily = "50 21 * * *"; };
type = types.attrsOf types.string;
description = ''
Periodicity at which intervals should be run by cron.
+3 -1
nixos/modules/services/logging/syslog-ng.nix
···
extraModulePaths = mkOption {
type = types.listOf types.str;
default = [];
-
example = [ "${pkgs.syslogng_incubator}/lib/syslog-ng" ];
description = ''
A list of paths that should be included in syslog-ng's
<literal>--module-path</literal> option. They should usually
···
extraModulePaths = mkOption {
type = types.listOf types.str;
default = [];
+
example = literalExample ''
+
[ "''${pkgs.syslogng_incubator}/lib/syslog-ng" ]
+
'';
description = ''
A list of paths that should be included in syslog-ng's
<literal>--module-path</literal> option. They should usually
+1 -1
nixos/modules/services/monitoring/smartd.nix
···
enable = mkOption {
default = false;
type = types.bool;
-
example = "true";
description = ''
Run smartd from the smartmontools package. Note that e-mail
notifications will not be enabled unless you configure the list of
···
enable = mkOption {
default = false;
type = types.bool;
+
example = true;
description = ''
Run smartd from the smartmontools package. Note that e-mail
notifications will not be enabled unless you configure the list of
+2 -2
nixos/modules/services/networking/ircd-hybrid/default.nix
···
rsaKey = mkOption {
default = null;
-
example = /root/certificates/irc.key;
description = "
IRCD server RSA key.
";
···
certificate = mkOption {
default = null;
-
example = /root/certificates/irc.pem;
description = "
IRCD server SSL certificate. There are some limitations - read manual.
";
···
rsaKey = mkOption {
default = null;
+
example = literalExample "/root/certificates/irc.key";
description = "
IRCD server RSA key.
";
···
certificate = mkOption {
default = null;
+
example = literalExample "/root/certificates/irc.pem";
description = "
IRCD server SSL certificate. There are some limitations - read manual.
";
+1 -1
nixos/modules/services/networking/znc.nix
···
modulePackages = mkOption {
type = types.listOf types.package;
default = [ ];
-
example = [ pkgs.zncModules.fish pkgs.zncModules.push ];
description = ''
A list of global znc module packages to add to znc.
'';
···
modulePackages = mkOption {
type = types.listOf types.package;
default = [ ];
+
example = literalExample "[ pkgs.zncModules.fish pkgs.zncModules.push ]";
description = ''
A list of global znc module packages to add to znc.
'';
+1 -1
nixos/modules/services/web-servers/apache-httpd/default.nix
···
package = mkOption {
type = types.package;
default = pkgs.apacheHttpd.override { mpm = mainCfg.multiProcessingModule; };
-
example = "pkgs.apacheHttpd_2_4";
description = ''
Overridable attribute of the Apache HTTP Server package to use.
'';
···
package = mkOption {
type = types.package;
default = pkgs.apacheHttpd.override { mpm = mainCfg.multiProcessingModule; };
+
example = literalExample "pkgs.apacheHttpd_2_4";
description = ''
Overridable attribute of the Apache HTTP Server package to use.
'';
+2 -2
nixos/modules/services/x11/desktop-managers/gnome3.nix
···
services.xserver.desktopManager.gnome3.sessionPath = mkOption {
default = [];
-
example = "[ pkgs.gnome3.gpaste ]";
description = "Additional list of packages to be added to the session search path.
Useful for gnome shell extensions or gsettings-conditionated autostart.";
apply = list: list ++ [ gnome3.gnome_shell ];
···
environment.gnome3.excludePackages = mkOption {
default = [];
-
example = "[ pkgs.gnome3.totem ]";
type = types.listOf types.package;
description = "Which packages gnome should exclude from the default environment";
};
···
services.xserver.desktopManager.gnome3.sessionPath = mkOption {
default = [];
+
example = literalExample "[ pkgs.gnome3.gpaste ]";
description = "Additional list of packages to be added to the session search path.
Useful for gnome shell extensions or gsettings-conditionated autostart.";
apply = list: list ++ [ gnome3.gnome_shell ];
···
environment.gnome3.excludePackages = mkOption {
default = [];
+
example = literalExample "[ pkgs.gnome3.totem ]";
type = types.listOf types.package;
description = "Which packages gnome should exclude from the default environment";
};
+1 -1
nixos/modules/services/x11/desktop-managers/kde4.nix
···
environment.kdePackages = mkOption {
default = [];
-
example = "[ pkgs.kde4.kdesdk ]";
type = types.listOf types.package;
description = "This option is obsolete. Please use <option>environment.systemPackages</option> instead.";
};
···
environment.kdePackages = mkOption {
default = [];
+
example = literalExample "[ pkgs.kde4.kdesdk ]";
type = types.listOf types.package;
description = "This option is obsolete. Please use <option>environment.systemPackages</option> instead.";
};
+4 -2
nixos/modules/services/x11/display-managers/default.nix
···
execCmd = mkOption {
type = types.str;
-
example = "${pkgs.slim}/bin/slim";
description = "Command to start the display manager.";
};
environment = mkOption {
type = types.attrsOf types.unspecified;
default = {};
-
example = { SLIM_CFGFILE = /etc/slim.conf; };
description = "Additional environment variables needed by the display manager.";
};
···
execCmd = mkOption {
type = types.str;
+
example = literalExample ''
+
"''${pkgs.slim}/bin/slim"
+
'';
description = "Command to start the display manager.";
};
environment = mkOption {
type = types.attrsOf types.unspecified;
default = {};
+
example = { SLIM_CFGFILE = "/etc/slim.conf"; };
description = "Additional environment variables needed by the display manager.";
};
+2 -2
nixos/modules/services/x11/xserver.nix
···
modules = mkOption {
type = types.listOf types.path;
default = [];
-
example = [ pkgs.xf86_input_wacom ];
description = "Packages to be added to the module search path of the X server.";
};
···
vaapiDrivers = mkOption {
type = types.listOf types.path;
default = [ ];
-
example = "[ pkgs.vaapiIntel pkgs.vaapiVdpau ]";
description = ''
Packages providing libva acceleration drivers.
'';
···
modules = mkOption {
type = types.listOf types.path;
default = [];
+
example = literalExample "[ pkgs.xf86_input_wacom ]";
description = "Packages to be added to the module search path of the X server.";
};
···
vaapiDrivers = mkOption {
type = types.listOf types.path;
default = [ ];
+
example = literalExample "[ pkgs.vaapiIntel pkgs.vaapiVdpau ]";
description = ''
Packages providing libva acceleration drivers.
'';