Project import generated by Copybara.

GitOrigin-RevId: 5e2018f7b383aeca6824a30c0cd1978c9532a46a
This commit is contained in:
Default email 2021-10-06 10:57:05 -03:00
parent 818c48e259
commit 5e2a688410
979 changed files with 7394 additions and 5295 deletions

View file

@ -65,6 +65,7 @@
/nixos/doc/manual/development/writing-modules.xml @nbp
/nixos/doc/manual/man-nixos-option.xml @nbp
/nixos/modules/installer/tools/nixos-option.sh @nbp
/nixos/modules/system @dasJ
# NixOS integration test driver
/nixos/lib/test-driver @tfc

View file

@ -28,6 +28,10 @@ jobs:
pairs:
- from: master
into: haskell-updates
- from: release-21.05
into: staging-next-21.05
- from: staging-next-21.05
into: staging-21.05
name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
steps:
- uses: actions/checkout@v2

View file

@ -30,10 +30,6 @@ jobs:
into: staging-next
- from: staging-next
into: staging
- from: release-21.05
into: staging-next-21.05
- from: staging-next-21.05
into: staging-21.05
name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
steps:
- uses: actions/checkout@v2

View file

@ -0,0 +1,18 @@
# /etc files {#etc}
Certain calls in glibc require access to runtime files found in /etc such as `/etc/protocols` or `/etc/services` -- [getprotobyname](https://linux.die.net/man/3/getprotobyname) is one such function.
On non-NixOS distributions these files are typically provided by packages (i.e. [netbase](https://packages.debian.org/sid/netbase)) if not already pre-installed in your distribution. This can cause non-reproducibility for code if they rely on these files being present.
If [iana-etc](https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.iana-etc.x86_64-linux) is part of your _buildInputs_ then it will set the environment varaibles `NIX_ETC_PROTOCOLS` and `NIX_ETC_SERVICES` to the corresponding files in the package through a _setup-hook_.
```bash
> nix-shell -p iana-etc
[nix-shell:~]$ env | grep NIX_ETC
NIX_ETC_SERVICES=/nix/store/aj866hr8fad8flnggwdhrldm0g799ccz-iana-etc-20210225/etc/services
NIX_ETC_PROTOCOLS=/nix/store/aj866hr8fad8flnggwdhrldm0g799ccz-iana-etc-20210225/etc/protocols
```
Nixpkg's version of [glibc](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/glibc/default.nix) has been patched to check for the existence of these environment variables. If the environment variable are *not set*, then it will attempt to find the files at the default location within _/etc_.

View file

@ -17,6 +17,7 @@
<xi:include href="kakoune.section.xml" />
<xi:include href="linux.section.xml" />
<xi:include href="locales.section.xml" />
<xi:include href="etc-files.section.xml" />
<xi:include href="nginx.section.xml" />
<xi:include href="opengl.section.xml" />
<xi:include href="shell-helpers.section.xml" />

View file

@ -181,6 +181,21 @@
rev = "${version}";
```
- Filling lists condionally _should_ be done with `lib.optional(s)` instead of using `if cond then [ ... ] else null` or `if cond then [ ... ] else [ ]`.
```nix
buildInputs = lib.optional stdenv.isDarwin iconv;
```
instead of
```nix
buildInputs = if stdenv.isDarwin then [ iconv ] else null;
```
As an exception, an explicit conditional expression with null can be used when fixing a important bug without triggering a mass rebuild.
If this is done a follow up pull request _should_ be created to change the code to `lib.optional(s)`.
- Arguments should be listed in the order they are used, with the exception of `lib`, which always goes first.
## Package naming {#sec-package-naming}

View file

@ -11,15 +11,7 @@
lib = import ./lib;
systems = [
"x86_64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"armv6l-linux"
"armv7l-linux"
"aarch64-darwin"
];
systems = lib.systems.supported.hydra;
forAllSystems = f: lib.genAttrs systems (system: f system);

View file

@ -123,8 +123,8 @@ let
inherit (self.options) isOption mkEnableOption mkSinkUndeclaredOptions
mergeDefaultOption mergeOneOption mergeEqualOption getValues
getFiles optionAttrSetToDocList optionAttrSetToDocList'
scrubOptionValue literalExample showOption showFiles
unknownModule mkOption;
scrubOptionValue literalExpression literalExample literalDocBook
showOption showFiles unknownModule mkOption;
inherit (self.types) isType setType defaultTypeMerge defaultFunctor
isOptionType mkOptionType;
inherit (self.asserts)

View file

@ -54,7 +54,7 @@ rec {
Example:
mkOption { } // => { _type = "option"; }
mkOption { defaultText = "foo"; } // => { _type = "option"; defaultText = "foo"; }
mkOption { default = "foo"; } // => { _type = "option"; default = "foo"; }
*/
mkOption =
{
@ -212,11 +212,25 @@ rec {
else x;
/* For use in the `example` option attribute. It causes the given
text to be included verbatim in documentation. This is necessary
for example values that are not simple values, e.g., functions.
/* For use in the `defaultText` and `example` option attributes. Causes the
given string to be rendered verbatim in the documentation as Nix code. This
is necessary for complex values, e.g. functions, or values that depend on
other values or packages.
*/
literalExample = text: { _type = "literalExample"; inherit text; };
literalExpression = text:
if ! isString text then throw "literalExpression expects a string."
else { _type = "literalExpression"; inherit text; };
literalExample = lib.warn "literalExample is deprecated, use literalExpression instead, or use literalDocBook for a non-Nix description." literalExpression;
/* For use in the `defaultText` and `example` option attributes. Causes the
given DocBook text to be inserted verbatim in the documentation, for when
a `literalExpression` would be too hard to read.
*/
literalDocBook = text:
if ! isString text then throw "literalDocBook expects a string."
else { _type = "literalDocBook"; inherit text; };
# Helper functions.

View file

@ -8,6 +8,7 @@ rec {
platforms = import ./platforms.nix { inherit lib; };
examples = import ./examples.nix { inherit lib; };
architectures = import ./architectures.nix { inherit lib; };
supported = import ./supported.nix { inherit lib; };
# Elaborate a `localSystem` or `crossSystem` so that it contains everything
# necessary.

View file

@ -0,0 +1,24 @@
# Supported systems according to RFC0046's definition.
#
# https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md
{ lib }:
rec {
# List of systems that are built by Hydra.
hydra = tier1 ++ tier2 ++ tier3;
tier1 = [
"x86_64-linux"
];
tier2 = [
"aarch64-linux"
"x86_64-darwin"
];
tier3 = [
"armv6l-linux"
"armv7l-linux"
"i686-linux"
"mipsel-linux"
];
}

View file

@ -254,8 +254,10 @@ checkConfigOutput / config.value.path ./types-anything/equal-atoms.nix
checkConfigOutput null config.value.null ./types-anything/equal-atoms.nix
checkConfigOutput 0.1 config.value.float ./types-anything/equal-atoms.nix
# Functions can't be merged together
checkConfigError "The option .* has conflicting definition values" config.value.multiple-lambdas ./types-anything/functions.nix
checkConfigError "The option .value.multiple-lambdas.<function body>. has conflicting option types" config.applied.multiple-lambdas ./types-anything/functions.nix
checkConfigOutput '<LAMBDA>' config.value.single-lambda ./types-anything/functions.nix
checkConfigOutput 'null' config.applied.merging-lambdas.x ./types-anything/functions.nix
checkConfigOutput 'null' config.applied.merging-lambdas.y ./types-anything/functions.nix
# Check that all mk* modifiers are applied
checkConfigError 'attribute .* not found' config.value.mkiffalse ./types-anything/mk-mods.nix
checkConfigOutput '{ }' config.value.mkiftrue ./types-anything/mk-mods.nix

View file

@ -1,16 +1,22 @@
{ lib, ... }: {
{ lib, config, ... }: {
options.value = lib.mkOption {
type = lib.types.anything;
};
options.applied = lib.mkOption {
default = lib.mapAttrs (name: fun: fun null) config.value;
};
config = lib.mkMerge [
{
value.single-lambda = x: x;
value.multiple-lambdas = x: x;
value.multiple-lambdas = x: { inherit x; };
value.merging-lambdas = x: { inherit x; };
}
{
value.multiple-lambdas = x: x;
value.multiple-lambdas = x: [ x ];
value.merging-lambdas = y: { inherit y; };
}
];

View file

@ -192,6 +192,12 @@ rec {
else (listOf anything).merge;
# This is the type of packages, only accept a single definition
stringCoercibleSet = mergeOneOption;
lambda = loc: defs: arg: anything.merge
(loc ++ [ "<function body>" ])
(map (def: {
file = def.file;
value = def.value arg;
}) defs);
# Otherwise fall back to only allowing all equal definitions
}.${commonType} or mergeEqualOption;
in mergeFunction loc defs;

View file

@ -3119,6 +3119,12 @@
githubId = 50854;
name = "edef";
};
edlimerkaj = {
name = "Edli Merkaj";
email = "edli.merkaj@identinet.io";
github = "edlimerkaj";
githubId = 71988351;
};
edibopp = {
email = "eduard.bopp@aepsil0n.de";
github = "edibopp";
@ -8914,6 +8920,12 @@
githubId = 11365056;
name = "Kevin Liu";
};
pnmadelaine = {
name = "Paul-Nicolas Madelaine";
email = "pnm@pnm.tf";
github = "pnmadelaine";
githubId = 21977014;
};
pnotequalnp = {
email = "kevin@pnotequalnp.com";
github = "pnotequalnp";
@ -10288,6 +10300,12 @@
fingerprint = "ADF4 C13D 0E36 1240 BD01 9B51 D1DE 6D7F 6936 63A5";
}];
};
simarra = {
name = "simarra";
email = "loic.martel@protonmail.com";
github = "simarra";
githubId = 14372987;
};
simonchatts = {
email = "code@chatts.net";
github = "simonchatts";

View file

@ -38,9 +38,19 @@ The function `mkOption` accepts the following arguments.
of the module will have to define the value of the option, otherwise
an error will be thrown.
`defaultText`
: A textual representation of the default value to be rendered verbatim in
the manual. Useful if the default value is a complex expression or depends
on other values or packages.
Use `lib.literalExpression` for a Nix expression, `lib.literalDocBook` for
a plain English description in DocBook format.
`example`
: An example value that will be shown in the NixOS manual.
You can use `lib.literalExpression` and `lib.literalDocBook` in the same way
as in `defaultText`.
`description`

View file

@ -57,13 +57,31 @@ options = {
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>defaultText</literal>
</term>
<listitem>
<para>
A textual representation of the default value to be rendered
verbatim in the manual. Useful if the default value is a
complex expression or depends on other values or packages. Use
<literal>lib.literalExpression</literal> for a Nix expression,
<literal>lib.literalDocBook</literal> for a plain English
description in DocBook format.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>example</literal>
</term>
<listitem>
<para>
An example value that will be shown in the NixOS manual.
An example value that will be shown in the NixOS manual. You
can use <literal>lib.literalExpression</literal> and
<literal>lib.literalDocBook</literal> in the same way as in
<literal>defaultText</literal>.
</para>
</listitem>
</varlistentry>

View file

@ -54,7 +54,7 @@
<para>
<emphasis>Default:</emphasis>
<xsl:text> </xsl:text>
<xsl:apply-templates select="attr[@name = 'default']" mode="top" />
<xsl:apply-templates select="attr[@name = 'default']/*" mode="top" />
</para>
</xsl:if>
@ -62,14 +62,7 @@
<para>
<emphasis>Example:</emphasis>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="attr[@name = 'example']/attrs[attr[@name = '_type' and string[@value = 'literalExample']]]">
<programlisting><xsl:value-of select="attr[@name = 'example']/attrs/attr[@name = 'text']/string/@value" /></programlisting>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="attr[@name = 'example']" mode="top" />
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="attr[@name = 'example']/*" mode="top" />
</para>
</xsl:if>
@ -107,20 +100,37 @@
</xsl:template>
<xsl:template match="*" mode="top">
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExpression']]]" mode = "top">
<xsl:choose>
<xsl:when test="string[contains(@value, '&#010;')]">
<programlisting>
<xsl:text>''
</xsl:text><xsl:value-of select='str:replace(string/@value, "${", "&apos;&apos;${")' /><xsl:text>''</xsl:text></programlisting>
<xsl:when test="contains(attr[@name = 'text']/string/@value, '&#010;')">
<programlisting><xsl:value-of select="attr[@name = 'text']/string/@value" /></programlisting>
</xsl:when>
<xsl:otherwise>
<literal><xsl:apply-templates /></literal>
<literal><xsl:value-of select="attr[@name = 'text']/string/@value" /></literal>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalDocBook']]]" mode = "top">
<xsl:value-of disable-output-escaping="yes" select="attr[@name = 'text']/string/@value" />
</xsl:template>
<xsl:template match="string[contains(@value, '&#010;')]" mode="top">
<programlisting>
<xsl:text>''&#010;</xsl:text>
<xsl:value-of select='str:replace(str:replace(@value, "&apos;&apos;", "&apos;&apos;&apos;"), "${", "&apos;&apos;${")' />
<xsl:text>''</xsl:text>
</programlisting>
</xsl:template>
<xsl:template match="*" mode="top">
<literal><xsl:apply-templates select="." /></literal>
</xsl:template>
<xsl:template match="null">
<xsl:text>null</xsl:text>
</xsl:template>
@ -129,10 +139,10 @@
<xsl:template match="string">
<xsl:choose>
<xsl:when test="(contains(@value, '&quot;') or contains(@value, '\')) and not(contains(@value, '&#010;'))">
<xsl:text>''</xsl:text><xsl:value-of select='str:replace(@value, "${", "&apos;&apos;${")' /><xsl:text>''</xsl:text>
<xsl:text>''</xsl:text><xsl:value-of select='str:replace(str:replace(@value, "&apos;&apos;", "&apos;&apos;&apos;"), "${", "&apos;&apos;${")' /><xsl:text>''</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>"</xsl:text><xsl:value-of select="str:replace(str:replace(str:replace(str:replace(@value, '\', '\\'), '&quot;', '\&quot;'), '&#010;', '\n'), '$', '\$')" /><xsl:text>"</xsl:text>
<xsl:text>"</xsl:text><xsl:value-of select="str:replace(str:replace(str:replace(str:replace(@value, '\', '\\'), '&quot;', '\&quot;'), '&#010;', '\n'), '${', '\${')" /><xsl:text>"</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
@ -163,7 +173,7 @@
</xsl:template>
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExample']]]">
<xsl:template match="attrs[attr[@name = '_type' and string[@value = 'literalExpression']]]">
<xsl:value-of select="attr[@name = 'text']/string/@value" />
</xsl:template>

View file

@ -27,7 +27,7 @@ in {
};
contents = mkOption {
example = literalExample ''
example = literalExpression ''
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}

View file

@ -61,7 +61,7 @@ in
fonts = mkOption {
type = types.listOf types.path;
default = [];
example = literalExample "[ pkgs.dejavu_fonts ]";
example = literalExpression "[ pkgs.dejavu_fonts ]";
description = "List of primary font paths.";
};

View file

@ -14,7 +14,7 @@ with lib;
allLocales = any (x: x == "all") config.i18n.supportedLocales;
locales = config.i18n.supportedLocales;
};
example = literalExample "pkgs.glibcLocales";
example = literalExpression "pkgs.glibcLocales";
description = ''
Customized pkg.glibcLocales package.

View file

@ -83,8 +83,8 @@ in {
kerberos = mkOption {
type = types.package;
default = pkgs.krb5Full;
defaultText = "pkgs.krb5Full";
example = literalExample "pkgs.heimdal";
defaultText = literalExpression "pkgs.krb5Full";
example = literalExpression "pkgs.heimdal";
description = ''
The Kerberos implementation that will be present in
<literal>environment.systemPackages</literal> after enabling this
@ -96,7 +96,7 @@ in {
type = with types; either attrs lines;
default = {};
apply = attrs: filterEmbeddedMetadata attrs;
example = literalExample ''
example = literalExpression ''
{
default_realm = "ATHENA.MIT.EDU";
};
@ -109,7 +109,7 @@ in {
realms = mkOption {
type = with types; either attrs lines;
default = {};
example = literalExample ''
example = literalExpression ''
{
"ATHENA.MIT.EDU" = {
admin_server = "athena.mit.edu";
@ -127,7 +127,7 @@ in {
domain_realm = mkOption {
type = with types; either attrs lines;
default = {};
example = literalExample ''
example = literalExpression ''
{
"example.com" = "EXAMPLE.COM";
".example.com" = "EXAMPLE.COM";
@ -142,7 +142,7 @@ in {
capaths = mkOption {
type = with types; either attrs lines;
default = {};
example = literalExample ''
example = literalExpression ''
{
"ATHENA.MIT.EDU" = {
"EXAMPLE.COM" = ".";
@ -161,7 +161,7 @@ in {
appdefaults = mkOption {
type = with types; either attrs lines;
default = {};
example = literalExample ''
example = literalExpression ''
{
pam = {
debug = false;
@ -182,7 +182,7 @@ in {
plugins = mkOption {
type = with types; either attrs lines;
default = {};
example = literalExample ''
example = literalExpression ''
{
ccselect = {
disable = "k5identity";

View file

@ -21,7 +21,7 @@ in
networking.hosts = lib.mkOption {
type = types.attrsOf (types.listOf types.str);
example = literalExample ''
example = literalExpression ''
{
"127.0.0.1" = [ "foo.bar.baz" ];
"192.168.0.2" = [ "fileserver.local" "nameserver.local" ];
@ -34,8 +34,8 @@ in
networking.hostFiles = lib.mkOption {
type = types.listOf types.path;
defaultText = lib.literalExample "Hosts from `networking.hosts` and `networking.extraHosts`";
example = lib.literalExample ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]'';
defaultText = literalDocBook "Hosts from <option>networking.hosts</option> and <option>networking.extraHosts</option>";
example = literalExpression ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]'';
description = ''
Files that should be concatenated together to form <filename>/etc/hosts</filename>.
'';

View file

@ -35,7 +35,7 @@ in
powerUpCommands = mkOption {
type = types.lines;
default = "";
example = literalExample ''
example = literalExpression ''
"''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"
'';
description =
@ -49,7 +49,7 @@ in
powerDownCommands = mkOption {
type = types.lines;
default = "";
example = literalExample ''
example = literalExpression ''
"''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"
'';
description =

View file

@ -149,8 +149,8 @@ in {
default = if config.services.jack.jackd.enable
then pkgs.pulseaudioFull
else pkgs.pulseaudio;
defaultText = "pkgs.pulseaudio";
example = literalExample "pkgs.pulseaudioFull";
defaultText = literalExpression "pkgs.pulseaudio";
example = literalExpression "pkgs.pulseaudioFull";
description = ''
The PulseAudio derivation to use. This can be used to enable
features (such as JACK support, Bluetooth) via the
@ -161,7 +161,7 @@ in {
extraModules = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.pulseaudio-modules-bt ]";
example = literalExpression "[ pkgs.pulseaudio-modules-bt ]";
description = ''
Extra pulseaudio modules to use. This is intended for out-of-tree
pulseaudio modules like extra bluetooth codecs.
@ -184,7 +184,7 @@ in {
type = types.attrsOf types.unspecified;
default = {};
description = "Config of the pulse daemon. See <literal>man pulse-daemon.conf</literal>.";
example = literalExample ''{ realtime-scheduling = "yes"; }'';
example = literalExpression ''{ realtime-scheduling = "yes"; }'';
};
};
@ -204,7 +204,7 @@ in {
allowedIpRanges = mkOption {
type = types.listOf types.str;
default = [];
example = literalExample ''[ "127.0.0.1" "192.168.1.0/24" ]'';
example = literalExpression ''[ "127.0.0.1" "192.168.1.0/24" ]'';
description = ''
A list of IP subnets that are allowed to stream to the server.
'';

View file

@ -136,10 +136,8 @@ in
environment.binsh = mkOption {
default = "${config.system.build.binsh}/bin/sh";
defaultText = "\${config.system.build.binsh}/bin/sh";
example = literalExample ''
"''${pkgs.dash}/bin/dash"
'';
defaultText = literalExpression ''"''${config.system.build.binsh}/bin/sh"'';
example = literalExpression ''"''${pkgs.dash}/bin/dash"'';
type = types.path;
visible = false;
description = ''
@ -152,7 +150,7 @@ in
environment.shells = mkOption {
default = [];
example = literalExample "[ pkgs.bashInteractive pkgs.zsh ]";
example = literalExpression "[ pkgs.bashInteractive pkgs.zsh ]";
description = ''
A list of permissible login shells for user accounts.
No need to mention <literal>/bin/sh</literal>

View file

@ -22,7 +22,7 @@ in
boot.kernel.sysctl = mkOption {
default = {};
example = literalExample ''
example = literalExpression ''
{ "net.ipv4.tcp_syncookies" = false; "vm.swappiness" = 60; }
'';
type = types.attrsOf sysctlOption;

View file

@ -58,7 +58,7 @@ in
systemPackages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
description = ''
The set of packages that appear in
/run/current-system/sw. These packages are
@ -73,9 +73,9 @@ in
defaultPackages = mkOption {
type = types.listOf types.package;
default = defaultPackages;
example = literalExample "[]";
example = [];
description = ''
Set of default packages that aren't strictly neccessary
Set of default packages that aren't strictly necessary
for a running system, entries can be removed for a more
minimal NixOS installation.

View file

@ -19,7 +19,7 @@ in {
environment.unixODBCDrivers = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "with pkgs.unixODBCDrivers; [ sqlite psql ]";
example = literalExpression "with pkgs.unixODBCDrivers; [ sqlite psql ]";
description = ''
Specifies Unix ODBC drivers to be registered in
<filename>/etc/odbcinst.ini</filename>. You may also want to

View file

@ -165,8 +165,8 @@ let
shell = mkOption {
type = types.nullOr (types.either types.shellPackage (passwdEntry types.path));
default = pkgs.shadow;
defaultText = "pkgs.shadow";
example = literalExample "pkgs.bashInteractive";
defaultText = literalExpression "pkgs.shadow";
example = literalExpression "pkgs.bashInteractive";
description = ''
The path to the user's shell. Can use shell derivations,
like <literal>pkgs.bashInteractive</literal>. Dont
@ -291,7 +291,7 @@ let
packages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
description = ''
The set of packages that should be made available to the user.
This is in contrast to <option>environment.systemPackages</option>,

View file

@ -37,7 +37,7 @@ in
default = { };
# Example taken from the manpage
example = literalExample ''
example = literalExpression ''
{
screencast = {
output_name = "HDMI-A-1";

View file

@ -27,7 +27,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.ckb-next;
defaultText = "pkgs.ckb-next";
defaultText = literalExpression "pkgs.ckb-next";
description = ''
The package implementing the Corsair keyboard/mouse driver.
'';

View file

@ -21,7 +21,7 @@ let
each .dtb file matching "compatible" of the overlay.
'';
default = null;
example = literalExample "./dts/overlays.dts";
example = literalExpression "./dts/overlays.dts";
};
dtsText = mkOption {
@ -31,7 +31,7 @@ let
Literal DTS contents, overlay is applied to
each .dtb file matching "compatible" of the overlay.
'';
example = literalExample ''
example = ''
/dts-v1/;
/plugin/;
/ {
@ -125,8 +125,8 @@ in
kernelPackage = mkOption {
default = config.boot.kernelPackages.kernel;
defaultText = "config.boot.kernelPackages.kernel";
example = literalExample "pkgs.linux_latest";
defaultText = literalExpression "config.boot.kernelPackages.kernel";
example = literalExpression "pkgs.linux_latest";
type = types.path;
description = ''
Kernel package containing the base device-tree (.dtb) to boot. Uses
@ -156,7 +156,7 @@ in
overlays = mkOption {
default = [];
example = literalExample ''
example = literalExpression ''
[
{ name = "pps"; dtsFile = ./dts/pps.dts; }
{ name = "spi";

View file

@ -19,7 +19,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.digitalbitbox;
defaultText = "pkgs.digitalbitbox";
defaultText = literalExpression "pkgs.digitalbitbox";
description = "The Digital Bitbox package to use. This can be used to install a package with udev rules that differ from the defaults.";
};
};

View file

@ -89,7 +89,7 @@ in
extraPackages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau intel-ocl ]";
example = literalExpression "with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau intel-ocl ]";
description = ''
Additional packages to add to OpenGL drivers. This can be used
to add OpenCL drivers, VA-API/VDPAU drivers etc.
@ -99,7 +99,7 @@ in
extraPackages32 = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "with pkgs.pkgsi686Linux; [ vaapiIntel libvdpau-va-gl vaapiVdpau ]";
example = literalExpression "with pkgs.pkgsi686Linux; [ vaapiIntel libvdpau-va-gl vaapiVdpau ]";
description = ''
Additional packages to add to 32-bit OpenGL drivers on
64-bit systems. Used when <option>driSupport32Bit</option> is

View file

@ -29,7 +29,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.opentabletdriver;
defaultText = "pkgs.opentabletdriver";
defaultText = literalExpression "pkgs.opentabletdriver";
description = ''
OpenTabletDriver derivation to use.
'';

View file

@ -72,10 +72,10 @@ in {
};
deviceUri = mkOption {
type = types.str;
example = [
example = literalExpression ''
"ipp://printserver.local/printers/BrotherHL_Workroom"
"usb://HP/DESKJET%20940C?serial=CN16E6C364BH"
];
'';
description = ''
How to reach the printer.
<command>lpinfo -v</command> shows a list of supported device URIs and schemes.
@ -83,8 +83,8 @@ in {
};
model = mkOption {
type = types.str;
example = literalExample ''
gutenprint.''${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}://brother-hl-5140/expert
example = literalExpression ''
"gutenprint.''${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}://brother-hl-5140/expert"
'';
description = ''
Location of the ppd driver file for the printer.

View file

@ -39,7 +39,7 @@ in
enable = mkEnableOption "SATA drive timeouts";
deciSeconds = mkOption {
example = "70";
example = 70;
type = types.int;
description = ''
Set SCT Error Recovery Control timeout in deciseconds for use in RAID configurations.

View file

@ -165,11 +165,11 @@ in
hardware.nvidia.package = lib.mkOption {
type = lib.types.package;
default = config.boot.kernelPackages.nvidiaPackages.stable;
defaultText = "config.boot.kernelPackages.nvidiaPackages.stable";
defaultText = literalExpression "config.boot.kernelPackages.nvidiaPackages.stable";
description = ''
The NVIDIA X11 derivation to use.
'';
example = "config.boot.kernelPackages.nvidiaPackages.legacy_340";
example = literalExpression "config.boot.kernelPackages.nvidiaPackages.legacy_340";
};
};

View file

@ -33,7 +33,7 @@ in
packages = mkOption {
type = types.listOf types.path;
example = literalExample "[ pkgs.tiscamera ]";
example = literalExpression "[ pkgs.tiscamera ]";
description = ''
List of packages containing <command>uvcvideo</command> dynamic controls
rules. All files found in

View file

@ -17,7 +17,7 @@ in
engines = mkOption {
type = with types; listOf fcitxEngine;
default = [];
example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
example = literalExpression "with pkgs.fcitx-engines; [ mozc hangul ]";
description =
let
enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;

View file

@ -12,7 +12,7 @@ in {
addons = mkOption {
type = with types; listOf package;
default = [];
example = with pkgs; [ fcitx5-rime ];
example = literalExpression "with pkgs; [ fcitx5-rime ]";
description = ''
Enabled Fcitx5 addons.
'';

View file

@ -36,7 +36,7 @@ in
engines = mkOption {
type = with types; listOf ibusEngine;
default = [];
example = literalExample "with pkgs.ibus-engines; [ mozc hangul ]";
example = literalExpression "with pkgs.ibus-engines; [ mozc hangul ]";
description =
let
enginesDrv = filterAttrs (const isDerivation) pkgs.ibus-engines;
@ -48,7 +48,7 @@ in
panel = mkOption {
type = with types; nullOr path;
default = null;
example = literalExample "''${pkgs.plasma5Packages.plasma-desktop}/lib/libexec/kimpanel-ibus-panel";
example = literalExpression ''"''${pkgs.plasma5Packages.plasma-desktop}/lib/libexec/kimpanel-ibus-panel"'';
description = "Replace the IBus panel with another panel.";
};
};

View file

@ -10,7 +10,7 @@ in
config = mkOption {
type = yamlFormat.type;
default = { };
example = literalExample ''
example = literalExpression ''
{
daemon = {
modules = ["Xim" "Indicator"];

View file

@ -528,7 +528,7 @@ in
};
isoImage.contents = mkOption {
example = literalExample ''
example = literalExpression ''
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}
@ -541,7 +541,7 @@ in
};
isoImage.storeContents = mkOption {
example = literalExample "[ pkgs.stdenv ]";
example = literalExpression "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated ISO image.

View file

@ -15,7 +15,7 @@ in
{
options = {
tarball.contents = mkOption {
example = literalExample ''
example = literalExpression ''
[ { source = pkgs.memtest86 + "/memtest.bin";
target = "boot/memtest.bin";
}
@ -28,7 +28,7 @@ in
};
tarball.storeContents = mkOption {
example = literalExample "[ pkgs.stdenv ]";
example = literalExpression "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated ISO image.

View file

@ -9,7 +9,7 @@ with lib;
options = {
netboot.storeContents = mkOption {
example = literalExample "[ pkgs.stdenv ]";
example = literalExpression "[ pkgs.stdenv ]";
description = ''
This option lists additional derivations to be included in the
Nix store in the generated netboot image.

View file

@ -49,7 +49,7 @@ in
storePaths = mkOption {
type = with types; listOf package;
example = literalExample "[ pkgs.stdenv ]";
example = literalExpression "[ pkgs.stdenv ]";
description = ''
Derivations to be included in the Nix store in the generated SD image.
'';
@ -107,7 +107,7 @@ in
};
populateFirmwareCommands = mkOption {
example = literalExample "'' cp \${pkgs.myBootLoader}/u-boot.bin firmware/ ''";
example = literalExpression "'' cp \${pkgs.myBootLoader}/u-boot.bin firmware/ ''";
description = ''
Shell commands to populate the ./firmware directory.
All files in that directory are copied to the
@ -116,7 +116,7 @@ in
};
populateRootCommands = mkOption {
example = literalExample "''\${config.boot.loader.generic-extlinux-compatible.populateCmd} -c \${config.system.build.toplevel} -d ./files/boot''";
example = literalExpression "''\${config.boot.loader.generic-extlinux-compatible.populateCmd} -c \${config.system.build.toplevel} -d ./files/boot''";
description = ''
Shell commands to populate the ./files directory.
All files in that directory are copied to the
@ -126,7 +126,7 @@ in
};
postBuildCommands = mkOption {
example = literalExample "'' dd if=\${pkgs.myBootLoader}/SPL of=$img bs=1024 seek=1 conv=notrunc ''";
example = literalExpression "'' dd if=\${pkgs.myBootLoader}/SPL of=$img bs=1024 seek=1 conv=notrunc ''";
default = "";
description = ''
Shell commands to run after the image is built.

View file

@ -133,7 +133,7 @@ in
extraOutputsToInstall = ["man"];
ignoreCollisions = true;
};
defaultText = "all man pages in config.environment.systemPackages";
defaultText = literalDocBook "all man pages in <option>config.environment.systemPackages</option>";
description = ''
The manual pages to generate caches for if <option>generateCaches</option>
is enabled. Must be a path to a directory with man pages under
@ -211,7 +211,7 @@ in
Which extra NixOS module paths the generated NixOS's documentation should strip
from options.
'';
example = literalExample ''
example = literalExpression ''
# e.g. with options from modules in ''${pkgs.customModules}/nix:
[ pkgs.customModules ]
'';

View file

@ -48,7 +48,7 @@ in
#disk = 6; # unused
#vsftpd = 7; # dynamically allocated ass of 2021-09-14
ftp = 8;
bitlbee = 9;
# bitlbee = 9; # removed 2021-10-05 #139765
#avahi = 10; # removed 2019-05-22
nagios = 11;
atd = 12;
@ -368,7 +368,7 @@ in
disk = 6;
#vsftpd = 7; # dynamically allocated as of 2021-09-14
ftp = 8;
bitlbee = 9;
# bitlbee = 9; # removed 2021-10-05 #139765
#avahi = 10; # removed 2019-05-22
#nagios = 11; # unused
atd = 12;

View file

@ -25,8 +25,8 @@ in {
locate = mkOption {
type = package;
default = pkgs.findutils;
defaultText = "pkgs.findutils";
example = "pkgs.mlocate";
defaultText = literalExpression "pkgs.findutils";
example = literalExpression "pkgs.mlocate";
description = ''
The locate implementation to use
'';

View file

@ -67,13 +67,13 @@ in
options.nixpkgs = {
pkgs = mkOption {
defaultText = literalExample
''import "''${nixos}/.." {
defaultText = literalExpression ''
import "''${nixos}/.." {
inherit (cfg) config overlays localSystem crossSystem;
}
'';
type = pkgsType;
example = literalExample "import <nixpkgs> {}";
example = literalExpression "import <nixpkgs> {}";
description = ''
If set, the pkgs argument to all NixOS modules is the value of
this option, extended with <code>nixpkgs.overlays</code>, if
@ -109,7 +109,7 @@ in
config = mkOption {
default = {};
example = literalExample
example = literalExpression
''
{ allowBroken = true; allowUnfree = true; }
'';
@ -125,7 +125,7 @@ in
overlays = mkOption {
default = [];
example = literalExample
example = literalExpression
''
[
(self: super: {
@ -158,7 +158,7 @@ in
# Make sure that the final value has all fields for sake of other modules
# referring to this. TODO make `lib.systems` itself use the module system.
apply = lib.systems.elaborate;
defaultText = literalExample
defaultText = literalExpression
''(import "''${nixos}/../lib").lib.systems.examples.aarch64-multiplatform'';
description = ''
Specifies the platform on which NixOS should be built. When

View file

@ -154,6 +154,7 @@
./programs/gnupg.nix
./programs/gphoto2.nix
./programs/hamster.nix
./programs/htop.nix
./programs/iftop.nix
./programs/iotop.nix
./programs/java.nix
@ -984,6 +985,7 @@
./services/web-apps/jirafeau.nix
./services/web-apps/jitsi-meet.nix
./services/web-apps/keycloak.nix
./services/web-apps/lemmy.nix
./services/web-apps/limesurvey.nix
./services/web-apps/mastodon.nix
./services/web-apps/mattermost.nix

View file

@ -19,7 +19,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.atop;
defaultText = "pkgs.atop";
defaultText = literalExpression "pkgs.atop";
description = ''
Which package to use for Atop.
'';
@ -37,7 +37,7 @@ in
package = mkOption {
type = types.package;
default = config.boot.kernelPackages.netatop;
defaultText = "config.boot.kernelPackages.netatop";
defaultText = literalExpression "config.boot.kernelPackages.netatop";
description = ''
Which package to use for netatop.
'';

View file

@ -14,7 +14,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.captive-browser;
defaultText = "pkgs.captive-browser";
defaultText = literalExpression "pkgs.captive-browser";
description = "Which package to use for captive-browser";
};

View file

@ -28,7 +28,7 @@ in {
# "nix-ccache --show-stats" and "nix-ccache --clear"
security.wrappers.nix-ccache = {
owner = "nobody";
owner = "root";
group = "nixbld";
setuid = false;
setgid = true;

View file

@ -33,7 +33,7 @@ in
for additional details.
'';
default = [];
example = literalExample ''
example = literalExpression ''
[
"chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
"mbniclmhobmnbdlbpiphghaielnnpgdp" # lightshot
@ -75,7 +75,7 @@ in
Make sure the selected policy is supported on Linux and your browser version.
'';
default = {};
example = literalExample ''
example = literalExpression ''
{
"BrowserSignin" = 0;
"SyncDisabled" = true;

View file

@ -25,14 +25,7 @@ if (!defined $res || scalar @$res == 0) {
print STDERR "$program: command not found\n";
} elsif (scalar @$res == 1) {
my $package = @$res[0]->{package};
if ($ENV{"NIX_AUTO_INSTALL"} // "") {
print STDERR <<EOF;
The program '$program' is currently not installed. It is provided by
the package '$package', which I will now install for you.
EOF
;
exit 126 if system("nix-env", "-iA", "nixos.$package") == 0;
} elsif ($ENV{"NIX_AUTO_RUN"} // "") {
if ($ENV{"NIX_AUTO_RUN"} // "") {
exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV));
} else {
print STDERR <<EOF;

View file

@ -19,7 +19,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.digitalbitbox;
defaultText = "pkgs.digitalbitbox";
defaultText = literalExpression "pkgs.digitalbitbox";
description = "The Digital Bitbox package to use. This can be used to install a package with udev rules that differ from the defaults.";
};
};

View file

@ -24,7 +24,7 @@ in {
package = mkOption {
default = pkgs.dmrconfig;
type = types.package;
defaultText = "pkgs.dmrconfig";
defaultText = literalExpression "pkgs.dmrconfig";
description = "dmrconfig derivation to use";
};
};

View file

@ -18,12 +18,16 @@ in
environment.variables =
{ NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix";
# note: many programs exec() this directly, so default options for less must not
# be specified here; do so in the default value of programs.less.envVariables instead
PAGER = mkDefault "less";
LESS = mkDefault "-R";
EDITOR = mkDefault "nano";
XDG_CONFIG_DIRS = [ "/etc/xdg" ]; # needs to be before profile-relative paths to allow changes through environment.etc
};
# since we set PAGER to this above, make sure it's installed
programs.less.enable = true;
environment.profiles = mkAfter
[ "/nix/var/nix/profiles/default"
"/run/current-system/sw"

View file

@ -18,6 +18,7 @@ in {
'';
type = types.package;
default = pkgs.feedbackd;
defaultText = literalExpression "pkgs.feedbackd";
};
};
};

View file

@ -40,13 +40,13 @@ in {
executable = mkOption {
type = types.path;
description = "Executable to run sandboxed";
example = literalExample "''${lib.getBin pkgs.firefox}/bin/firefox";
example = literalExpression ''"''${lib.getBin pkgs.firefox}/bin/firefox"'';
};
profile = mkOption {
type = types.nullOr types.path;
default = null;
description = "Profile to use";
example = literalExample "''${pkgs.firejail}/etc/firejail/firefox.profile";
example = literalExpression ''"''${pkgs.firejail}/etc/firejail/firefox.profile"'';
};
extraArgs = mkOption {
type = types.listOf types.str;
@ -57,7 +57,7 @@ in {
};
}));
default = {};
example = literalExample ''
example = literalExpression ''
{
firefox = {
executable = "''${lib.getBin pkgs.firefox}/bin/firefox";

View file

@ -13,7 +13,7 @@ in {
description = "FLEXOPTIX app package to use";
type = types.package;
default = pkgs.flexoptix-app;
defaultText = "\${pkgs.flexoptix-app}";
defaultText = literalExpression "pkgs.flexoptix-app";
};
};
};

View file

@ -17,7 +17,7 @@ in
environment.freetds = mkOption {
type = types.attrsOf types.str;
default = {};
example = literalExample ''
example = literalExpression ''
{ MYDATABASE = '''
host = 10.0.2.100
port = 1433

View file

@ -23,7 +23,7 @@ in
System-wide configuration for GameMode (/etc/gamemode.ini).
See gamemoded(8) man page for available settings.
'';
example = literalExample ''
example = literalExpression ''
{
general = {
renice = 10;

View file

@ -14,8 +14,8 @@ in
package = mkOption {
type = types.package;
default = pkgs.git;
defaultText = "pkgs.git";
example = literalExample "pkgs.gitFull";
defaultText = literalExpression "pkgs.git";
example = literalExpression "pkgs.gitFull";
description = "The git package to use";
};

View file

@ -27,7 +27,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.gnupg;
defaultText = "pkgs.gnupg";
defaultText = literalExpression "pkgs.gnupg";
description = ''
The gpg package that should be used.
'';

View file

@ -0,0 +1,58 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.htop;
fmt = value:
if isList value then concatStringsSep " " (map fmt value) else
if isString value then value else
if isBool value || isInt value then toString value else
throw "Unrecognized type ${typeOf value} in htop settings";
in
{
options.programs.htop = {
package = mkOption {
type = types.package;
default = pkgs.htop;
defaultText = "pkgs.htop";
description = ''
The htop package that should be used.
'';
};
enable = mkEnableOption "htop process monitor";
settings = mkOption {
type = with types; attrsOf (oneOf [ str int bool (listOf (oneOf [ str int bool ])) ]);
default = {};
example = {
hide_kernel_threads = true;
hide_userland_threads = true;
};
description = ''
Extra global default configuration for htop
which is read on first startup only.
Htop subsequently uses ~/.config/htop/htoprc
as configuration source.
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages = [
cfg.package
];
environment.etc."htoprc".text = ''
# Global htop configuration
# To change set: programs.htop.settings.KEY = VALUE;
'' + concatStringsSep "\n" (mapAttrsToList (key: value: "${key}=${fmt value}") cfg.settings);
};
}

View file

@ -34,7 +34,7 @@ in
package = mkOption {
default = pkgs.jdk;
defaultText = "pkgs.jdk";
defaultText = literalExpression "pkgs.jdk";
description = ''
Java package to install. Typical values are pkgs.jdk or pkgs.jre.
'';

View file

@ -13,9 +13,9 @@ with lib;
'';
package = mkOption {
default = pkgs.kdeconnect;
defaultText = "pkgs.kdeconnect";
defaultText = literalExpression "pkgs.kdeconnect";
type = types.package;
example = literalExample "pkgs.gnomeExtensions.gsconnect";
example = literalExpression "pkgs.gnomeExtensions.gsconnect";
description = ''
The package providing the implementation for kdeconnect.
'';

View file

@ -24,9 +24,7 @@ let
}
'';
lessKey = pkgs.runCommand "lesskey"
{ src = pkgs.writeText "lessconfig" configText; preferLocalBuild = true; }
"${pkgs.less}/bin/lesskey -o $out $src";
lessKey = pkgs.writeText "lessconfig" configText;
in
@ -35,12 +33,14 @@ in
programs.less = {
# note that environment.nix sets PAGER=less, and
# therefore also enables this module
enable = mkEnableOption "less";
configFile = mkOption {
type = types.nullOr types.path;
default = null;
example = literalExample "\${pkgs.my-configs}/lesskey";
example = literalExpression ''"''${pkgs.my-configs}/lesskey"'';
description = ''
Path to lesskey configuration file.
@ -81,7 +81,9 @@ in
envVariables = mkOption {
type = types.attrsOf types.str;
default = {};
default = {
LESS = "-R";
};
example = {
LESS = "--quit-if-one-screen";
};
@ -91,6 +93,7 @@ in
lessopen = mkOption {
type = types.nullOr types.str;
default = "|${pkgs.lesspipe}/bin/lesspipe.sh %s";
defaultText = literalExpression ''"|''${pkgs.lesspipe}/bin/lesspipe.sh %s"'';
description = ''
Before less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are displayed.
'';
@ -111,7 +114,7 @@ in
environment.systemPackages = [ pkgs.less ];
environment.variables = {
LESSKEY_SYSTEM = toString lessKey;
LESSKEYIN_SYSTEM = toString lessKey;
} // optionalAttrs (cfg.lessopen != null) {
LESSOPEN = cfg.lessopen;
} // optionalAttrs (cfg.lessclose != null) {

View file

@ -33,7 +33,7 @@ in
security.wrappers = mkIf cfg.withUtempter {
utempter = {
source = "${pkgs.libutempter}/lib/utempter/utempter";
owner = "nobody";
owner = "root";
group = "utmp";
setuid = false;
setgid = true;

View file

@ -20,6 +20,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.mtr;
defaultText = literalExpression "pkgs.mtr";
description = ''
The package to use.
'';

View file

@ -47,18 +47,18 @@ in {
configure = mkOption {
type = types.attrs;
default = {};
example = literalExample ''
configure = {
customRC = $''''
example = literalExpression ''
{
customRC = '''
" here your custom configuration goes!
$'''';
''';
packages.myVimPackage = with pkgs.vimPlugins; {
# loaded on launch
start = [ fugitive ];
# manually loadable by calling `:packadd $plugin-name`
opt = [ ];
};
};
}
'';
description = ''
Generate your init file from your list of plugins and custom commands.
@ -69,7 +69,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.neovim-unwrapped;
defaultText = literalExample "pkgs.neovim-unwrapped";
defaultText = literalExpression "pkgs.neovim-unwrapped";
description = "The package to use for the neovim binary.";
};
@ -82,8 +82,8 @@ in {
runtime = mkOption {
default = {};
example = literalExample ''
runtime."ftplugin/c.vim".text = "setlocal omnifunc=v:lua.vim.lsp.omnifunc";
example = literalExpression ''
{ "ftplugin/c.vim".text = "setlocal omnifunc=v:lua.vim.lsp.omnifunc"; }
'';
description = ''
Set of files that have to be linked in <filename>runtime</filename>.

View file

@ -10,6 +10,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.noisetorch;
defaultText = literalExpression "pkgs.noisetorch";
description = ''
The noisetorch package to use.
'';

View file

@ -14,10 +14,11 @@ in
enable = mkEnableOption "<command>npm</command> global config";
package = mkOption {
type = types.path;
type = types.package;
description = "The npm package version / flavor to use";
default = pkgs.nodePackages.npm;
example = literalExample "pkgs.nodePackages_13_x.npm";
defaultText = literalExpression "pkgs.nodePackages.npm";
example = literalExpression "pkgs.nodePackages_13_x.npm";
};
npmrc = mkOption {

View file

@ -120,7 +120,7 @@ in {
Proxies to be used by proxychains.
'';
example = literalExample ''
example = literalExpression ''
{ myproxy =
{ type = "socks4";
host = "127.0.0.1";

View file

@ -66,7 +66,7 @@ in
This must not be a store path, since the path is
used outside the store (in particular in /etc/passwd).
'';
example = literalExample "pkgs.zsh";
example = literalExpression "pkgs.zsh";
type = types.either types.path types.shellPackage;
};

View file

@ -29,11 +29,13 @@ in
terminal_su = "${pkgs.sudo}/bin/sudo";
graphical_su = "${pkgs.gksu}/bin/gksu";
};
example = literalExample ''{
defaultText = literalExpression ''
{
tmp_dir = "/tmp";
terminal_su = "''${pkgs.sudo}/bin/sudo";
graphical_su = "''${pkgs.gksu}/bin/gksu";
}'';
}
'';
description = ''
The system-wide spacefm configuration.
Parameters to be written to <filename>/etc/spacefm/spacefm.conf</filename>.

View file

@ -36,6 +36,7 @@ in
askPassword = mkOption {
type = types.str;
default = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass";
defaultText = literalExpression ''"''${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"'';
description = "Program used by SSH to ask for passwords.";
};
@ -113,7 +114,7 @@ in
agentPKCS11Whitelist = mkOption {
type = types.nullOr types.str;
default = null;
example = "\${pkgs.opensc}/lib/opensc-pkcs11.so";
example = literalExpression ''"''${pkgs.opensc}/lib/opensc-pkcs11.so"'';
description = ''
A pattern-list of acceptable paths for PKCS#11 shared libraries
that may be used with the -s option to ssh-add.
@ -123,7 +124,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.openssh;
defaultText = "pkgs.openssh";
defaultText = literalExpression "pkgs.openssh";
description = ''
The package used for the openssh client and daemon.
'';
@ -180,7 +181,7 @@ in
description = ''
The set of system-wide known SSH hosts.
'';
example = literalExample ''
example = literalExpression ''
{
myhost = {
hostNames = [ "myhost" "myhost.mydomain.com" "10.10.1.4" ];

View file

@ -54,7 +54,7 @@ in
<citerefentry><refentrytitle>ssmtp</refentrytitle><manvolnum>5</manvolnum></citerefentry> configuration. Refer
to <link xlink:href="https://linux.die.net/man/5/ssmtp.conf"/> for details on supported values.
'';
example = literalExample ''
example = literalExpression ''
{
Debug = true;
FromLineOverride = false;

View file

@ -92,10 +92,10 @@ in {
default = with pkgs; [
swaylock swayidle alacritty dmenu
];
defaultText = literalExample ''
defaultText = literalExpression ''
with pkgs; [ swaylock swayidle alacritty dmenu ];
'';
example = literalExample ''
example = literalExpression ''
with pkgs; [
i3status i3status-rust
termite rofi light

View file

@ -5,7 +5,7 @@ let
inherit (builtins) length map;
inherit (lib.attrsets) attrNames filterAttrs hasAttr mapAttrs mapAttrsToList optionalAttrs;
inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) literalExample mkEnableOption mkOption;
inherit (lib.options) literalExpression mkEnableOption mkOption;
inherit (lib.strings) concatStringsSep optionalString toLower;
inherit (lib.types) addCheck attrsOf lines nullOr package path port str strMatching submodule;
@ -123,7 +123,7 @@ let
};
options.text = mkOption {
type = lines;
example = literalExample
example = literalExpression
''lib.modules.mkAfter "compression no"'';
description = ''
Additional text lines for the server stanza.
@ -218,8 +218,8 @@ let
package = mkOption {
type = package;
default = pkgs.tsm-client;
defaultText = "pkgs.tsm-client";
example = literalExample "pkgs.tsm-client-withGui";
defaultText = literalExpression "pkgs.tsm-client";
example = literalExpression "pkgs.tsm-client-withGui";
description = ''
The TSM client derivation to be
added to the system environment.

View file

@ -18,8 +18,8 @@ in {
package = mkOption {
type = types.package;
default = pkgs.vim;
defaultText = "pkgs.vim";
example = "pkgs.vimHugeX";
defaultText = literalExpression "pkgs.vim";
example = literalExpression "pkgs.vimHugeX";
description = ''
vim package to use.
'';

View file

@ -19,7 +19,7 @@ in {
package = mkOption {
type = types.package;
default = pkgs.wireshark-cli;
defaultText = "pkgs.wireshark-cli";
defaultText = literalExpression "pkgs.wireshark-cli";
description = ''
Which Wireshark package to install in the global environment.
'';

View file

@ -27,7 +27,8 @@ in
package = mkOption {
type = types.package;
default = pkgs.xonsh;
example = literalExample "pkgs.xonsh.override { configFile = \"/path/to/xonshrc\"; }";
defaultText = literalExpression "pkgs.xonsh";
example = literalExpression "pkgs.xonsh.override { configFile = \"/path/to/xonshrc\"; }";
description = ''
xonsh package to use.
'';

View file

@ -11,7 +11,8 @@ in
lockerCommand = mkOption {
default = "${pkgs.i3lock}/bin/i3lock";
example = literalExample "\${pkgs.i3lock-fancy}/bin/i3lock-fancy";
defaultText = literalExpression ''"''${pkgs.i3lock}/bin/i3lock"'';
example = literalExpression ''"''${pkgs.i3lock-fancy}/bin/i3lock-fancy"'';
type = types.separatedString " ";
description = "Locker to be used with xsslock";
};

View file

@ -16,9 +16,8 @@ in
type = types.str;
default = optionalString config.fonts.fontDir.enable
"/run/current-system/sw/share/X11/fonts";
defaultText = literalExample ''
optionalString config.fonts.fontDir.enable
"/run/current-system/sw/share/X11/fonts";
defaultText = literalExpression ''
optionalString config.fonts.fontDir.enable "/run/current-system/sw/share/X11/fonts"
'';
description = ''
Default font path. Setting this option causes Xwayland to be rebuilt.
@ -30,10 +29,10 @@ in
default = pkgs.xwayland.override (oldArgs: {
inherit (cfg) defaultFontPath;
});
defaultText = literalExample ''
defaultText = literalExpression ''
pkgs.xwayland.override (oldArgs: {
inherit (config.programs.xwayland) defaultFontPath;
});
})
'';
description = "The Xwayland package to use.";
};

View file

@ -45,7 +45,8 @@ in
package = mkOption {
default = pkgs.yabar-unstable;
example = literalExample "pkgs.yabar";
defaultText = literalExpression "pkgs.yabar-unstable";
example = literalExpression "pkgs.yabar";
type = types.package;
# `yabar-stable` segfaults under certain conditions.

View file

@ -48,7 +48,7 @@ in
package = mkOption {
default = pkgs.oh-my-zsh;
defaultText = "pkgs.oh-my-zsh";
defaultText = literalExpression "pkgs.oh-my-zsh";
description = ''
Package to install for `oh-my-zsh` usage.
'';

View file

@ -10,7 +10,7 @@ in {
enable = mkEnableOption "zsh-autoenv";
package = mkOption {
default = pkgs.zsh-autoenv;
defaultText = "pkgs.zsh-autoenv";
defaultText = literalExpression "pkgs.zsh-autoenv";
description = ''
Package to install for `zsh-autoenv` usage.
'';

View file

@ -40,7 +40,7 @@ in
type = with types; attrsOf str;
default = {};
description = "Attribute set with additional configuration values";
example = literalExample ''
example = literalExpression ''
{
"ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" = "20";
}

View file

@ -42,7 +42,7 @@ in
default = {};
type = types.attrsOf types.str;
example = literalExample ''
example = literalExpression ''
{
"rm -rf *" = "fg=white,bold,bg=red";
}
@ -59,7 +59,7 @@ in
default = {};
type = types.attrsOf types.str;
example = literalExample ''
example = literalExpression ''
{
"alias" = "fg=magenta,bold";
}

View file

@ -486,7 +486,7 @@ let
extraDomainNames = mkOption {
type = types.listOf types.str;
default = [];
example = literalExample ''
example = literalExpression ''
[
"example.org"
"mydomain.org"
@ -656,7 +656,7 @@ in {
to those units if they rely on the certificates being present,
or trigger restarts of the service if certificates get renewed.
'';
example = literalExample ''
example = literalExpression ''
{
"example.com" = {
webroot = "/var/lib/acme/acme-challenge/";

View file

@ -24,7 +24,7 @@ in
security.pki.certificateFiles = mkOption {
type = types.listOf types.path;
default = [];
example = literalExample "[ \"\${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt\" ]";
example = literalExpression ''[ "''${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]'';
description = ''
A list of files containing trusted root certificates in PEM
format. These are concatenated to form
@ -37,7 +37,7 @@ in
security.pki.certificates = mkOption {
type = types.listOf types.str;
default = [];
example = literalExample ''
example = literalExpression ''
[ '''
NixOS.org
=========

View file

@ -53,7 +53,7 @@ in {
coerce = bits: { inherit bits; };
in attrsOf (coercedTo int coerce (submodule paramsSubmodule));
default = {};
example = lib.literalExample "{ nginx.bits = 3072; }";
example = lib.literalExpression "{ nginx.bits = 3072; }";
description = ''
Diffie-Hellman parameters to generate.

View file

@ -77,7 +77,7 @@ in
You can use <code>mkBefore</code> and/or <code>mkAfter</code> to ensure
this is the case when configuration options are merged.
'';
example = literalExample ''
example = literalExpression ''
[
# Allow execution of any command by any user in group doas, requiring
# a password and keeping any previously-defined environment variables.

View file

@ -586,7 +586,7 @@ in
};
security.pam.services = mkOption {
default = [];
default = {};
type = with types; attrsOf (submodule pamOpts);
description =
''

View file

@ -33,7 +33,7 @@ in
additionalSearchPaths = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.bindfs ]";
example = literalExpression "[ pkgs.bindfs ]";
description = ''
Additional programs to include in the search path of pam_mount.
Useful for example if you want to use some FUSE filesystems like bindfs.
@ -43,7 +43,7 @@ in
fuseMountOptions = mkOption {
type = types.listOf types.str;
default = [];
example = literalExample ''
example = literalExpression ''
[ "nodev" "nosuid" "force-user=%(USER)" "gid=%(USERGID)" "perms=0700" "chmod-deny" "chown-deny" "chgrp-deny" ]
'';
description = ''

Some files were not shown because too many files have changed in this diff Show more