diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix
index db4b6c638ab4..560918302ca6 100644
--- a/nixos/modules/config/fonts/fontdir.nix
+++ b/nixos/modules/config/fonts/fontdir.nix
@@ -39,6 +39,7 @@ in
decompressFonts = mkOption {
type = types.bool;
default = config.programs.xwayland.enable;
+ defaultText = literalExpression "config.programs.xwayland.enable";
description = ''
Whether to decompress fonts in
/run/current-system/sw/share/X11/fonts.
diff --git a/nixos/modules/config/gtk/gtk-icon-cache.nix b/nixos/modules/config/gtk/gtk-icon-cache.nix
index 7441f4de40eb..ff9aa7c6a047 100644
--- a/nixos/modules/config/gtk/gtk-icon-cache.nix
+++ b/nixos/modules/config/gtk/gtk-icon-cache.nix
@@ -6,6 +6,7 @@ with lib;
gtk.iconCache.enable = mkOption {
type = types.bool;
default = config.services.xserver.enable;
+ defaultText = literalExpression "config.services.xserver.enable";
description = ''
Whether to build icon theme caches for GTK applications.
'';
diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix
index 545d4a3dca61..5b8d5b214496 100644
--- a/nixos/modules/config/i18n.nix
+++ b/nixos/modules/config/i18n.nix
@@ -14,6 +14,12 @@ with lib;
allLocales = any (x: x == "all") config.i18n.supportedLocales;
locales = config.i18n.supportedLocales;
};
+ defaultText = literalExpression ''
+ pkgs.buildPackages.glibcLocales.override {
+ allLocales = any (x: x == "all") config.i18n.supportedLocales;
+ locales = config.i18n.supportedLocales;
+ }
+ '';
example = literalExpression "pkgs.glibcLocales";
description = ''
Customized pkg.glibcLocales package.
diff --git a/nixos/modules/misc/meta.nix b/nixos/modules/misc/meta.nix
index 1410e33342a6..3dd97cbec235 100644
--- a/nixos/modules/misc/meta.nix
+++ b/nixos/modules/misc/meta.nix
@@ -37,7 +37,7 @@ in
type = listOfMaintainers;
internal = true;
default = [];
- example = [ lib.maintainers.all ];
+ example = literalExpression ''[ lib.maintainers.all ]'';
description = ''
List of maintainers of each module. This option should be defined at
most once per module.
diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix
index b03bf290fd23..8ed7a721a3ef 100644
--- a/nixos/modules/security/pam.nix
+++ b/nixos/modules/security/pam.nix
@@ -38,6 +38,7 @@ let
p11Auth = mkOption {
default = config.security.pam.p11.enable;
+ defaultText = literalExpression "config.security.pam.p11.enable";
type = types.bool;
description = ''
If set, keys listed in
@@ -49,6 +50,7 @@ let
u2fAuth = mkOption {
default = config.security.pam.u2f.enable;
+ defaultText = literalExpression "config.security.pam.u2f.enable";
type = types.bool;
description = ''
If set, users listed in
@@ -61,6 +63,7 @@ let
yubicoAuth = mkOption {
default = config.security.pam.yubico.enable;
+ defaultText = literalExpression "config.security.pam.yubico.enable";
type = types.bool;
description = ''
If set, users listed in
@@ -83,6 +86,7 @@ let
usbAuth = mkOption {
default = config.security.pam.usb.enable;
+ defaultText = literalExpression "config.security.pam.usb.enable";
type = types.bool;
description = ''
If set, users listed in
@@ -93,6 +97,7 @@ let
otpwAuth = mkOption {
default = config.security.pam.enableOTPW;
+ defaultText = literalExpression "config.security.pam.enableOTPW";
type = types.bool;
description = ''
If set, the OTPW system will be used (if
@@ -126,6 +131,7 @@ let
fprintAuth = mkOption {
default = config.services.fprintd.enable;
+ defaultText = literalExpression "config.services.fprintd.enable";
type = types.bool;
description = ''
If set, fingerprint reader will be used (if exists and
@@ -135,6 +141,7 @@ let
oathAuth = mkOption {
default = config.security.pam.oath.enable;
+ defaultText = literalExpression "config.security.pam.oath.enable";
type = types.bool;
description = ''
If set, the OATH Toolkit will be used.
@@ -249,6 +256,7 @@ let
pamMount = mkOption {
default = config.security.pam.mount.enable;
+ defaultText = literalExpression "config.security.pam.mount.enable";
type = types.bool;
description = ''
Enable PAM mount (pam_mount) system to mount fileystems on user login.
diff --git a/nixos/modules/services/audio/icecast.nix b/nixos/modules/services/audio/icecast.nix
index 6ca20a7a1086..5ee5bd745f96 100644
--- a/nixos/modules/services/audio/icecast.nix
+++ b/nixos/modules/services/audio/icecast.nix
@@ -50,6 +50,7 @@ in {
type = types.nullOr types.str;
description = "DNS name or IP address that will be used for the stream directory lookups or possibily the playlist generation if a Host header is not provided.";
default = config.networking.domain;
+ defaultText = literalExpression "config.networking.domain";
};
admin = {
diff --git a/nixos/modules/services/audio/ympd.nix b/nixos/modules/services/audio/ympd.nix
index 36c5527027ff..84b72d142513 100644
--- a/nixos/modules/services/audio/ympd.nix
+++ b/nixos/modules/services/audio/ympd.nix
@@ -31,6 +31,7 @@ in {
port = mkOption {
type = types.int;
default = config.services.mpd.network.port;
+ defaultText = literalExpression "config.services.mpd.network.port";
description = "The port where MPD is listening.";
example = 6600;
};
diff --git a/nixos/modules/services/backup/bacula.nix b/nixos/modules/services/backup/bacula.nix
index cc8b77cbfbe8..598902042346 100644
--- a/nixos/modules/services/backup/bacula.nix
+++ b/nixos/modules/services/backup/bacula.nix
@@ -302,6 +302,7 @@ in {
name = mkOption {
default = "${config.networking.hostName}-fd";
+ defaultText = literalExpression ''"''${config.networking.hostName}-fd"'';
type = types.str;
description = ''
The client name that must be used by the Director when connecting.
@@ -364,6 +365,7 @@ in {
name = mkOption {
default = "${config.networking.hostName}-sd";
+ defaultText = literalExpression ''"''${config.networking.hostName}-sd"'';
type = types.str;
description = ''
Specifies the Name of the Storage daemon.
@@ -439,6 +441,7 @@ in {
name = mkOption {
default = "${config.networking.hostName}-dir";
+ defaultText = literalExpression ''"''${config.networking.hostName}-dir"'';
type = types.str;
description = ''
The director name used by the system administrator. This directive is
diff --git a/nixos/modules/services/cluster/kubernetes/kubelet.nix b/nixos/modules/services/cluster/kubernetes/kubelet.nix
index eb0cb1f3dbc0..2806f73375bc 100644
--- a/nixos/modules/services/cluster/kubernetes/kubelet.nix
+++ b/nixos/modules/services/cluster/kubernetes/kubelet.nix
@@ -168,6 +168,7 @@ in
hostname = mkOption {
description = "Kubernetes kubelet hostname override.";
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
type = str;
};
diff --git a/nixos/modules/services/cluster/kubernetes/pki.nix b/nixos/modules/services/cluster/kubernetes/pki.nix
index faf951d81574..76ab03cd520b 100644
--- a/nixos/modules/services/cluster/kubernetes/pki.nix
+++ b/nixos/modules/services/cluster/kubernetes/pki.nix
@@ -98,6 +98,7 @@ in
the public and private keys respectively.
'';
default = "${config.services.cfssl.dataDir}/ca";
+ defaultText = literalExpression ''"''${config.services.cfssl.dataDir}/ca"'';
type = str;
};
diff --git a/nixos/modules/services/cluster/kubernetes/proxy.nix b/nixos/modules/services/cluster/kubernetes/proxy.nix
index a92043d52597..a09efcef94ea 100644
--- a/nixos/modules/services/cluster/kubernetes/proxy.nix
+++ b/nixos/modules/services/cluster/kubernetes/proxy.nix
@@ -37,6 +37,7 @@ in
hostname = mkOption {
description = "Kubernetes proxy hostname override.";
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
type = str;
};
diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix
index 0c96f3231329..d2f3feffc970 100644
--- a/nixos/modules/services/computing/slurm/slurm.nix
+++ b/nixos/modules/services/computing/slurm/slurm.nix
@@ -80,6 +80,7 @@ in
dbdHost = mkOption {
type = types.str;
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
description = ''
Hostname of the machine where slurmdbd
is running (i.e. name returned by hostname -s).
diff --git a/nixos/modules/services/continuous-integration/github-runner.nix b/nixos/modules/services/continuous-integration/github-runner.nix
index 943c1e4598df..59370f43fe75 100644
--- a/nixos/modules/services/continuous-integration/github-runner.nix
+++ b/nixos/modules/services/continuous-integration/github-runner.nix
@@ -58,6 +58,7 @@ in
'';
example = "nixos";
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
};
runnerGroup = mkOption {
diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix
index d6cde77c0a3f..ccb7cc21734e 100644
--- a/nixos/modules/services/continuous-integration/hydra/default.nix
+++ b/nixos/modules/services/continuous-integration/hydra/default.nix
@@ -203,6 +203,7 @@ in
buildMachinesFiles = mkOption {
type = types.listOf types.path;
default = optional (config.nix.buildMachines != []) "/etc/nix/machines";
+ defaultText = literalExpression ''optional (config.nix.buildMachines != []) "/etc/nix/machines"'';
example = [ "/etc/nix/machines" "/var/lib/hydra/provisioner/machines" ];
description = "List of files containing build machines.";
};
diff --git a/nixos/modules/services/logging/journalwatch.nix b/nixos/modules/services/logging/journalwatch.nix
index 576c646c0f58..fb86904d1ea2 100644
--- a/nixos/modules/services/logging/journalwatch.nix
+++ b/nixos/modules/services/logging/journalwatch.nix
@@ -74,6 +74,7 @@ in {
mailFrom = mkOption {
type = types.str;
default = "journalwatch@${config.networking.hostName}";
+ defaultText = literalExpression ''"journalwatch@''${config.networking.hostName}"'';
description = ''
Mail address to send journalwatch reports from.
'';
diff --git a/nixos/modules/services/logging/klogd.nix b/nixos/modules/services/logging/klogd.nix
index 2d1f515da920..8d371c161eb1 100644
--- a/nixos/modules/services/logging/klogd.nix
+++ b/nixos/modules/services/logging/klogd.nix
@@ -10,6 +10,7 @@ with lib;
services.klogd.enable = mkOption {
type = types.bool;
default = versionOlder (getVersion config.boot.kernelPackages.kernel) "3.5";
+ defaultText = literalExpression ''versionOlder (getVersion config.boot.kernelPackages.kernel) "3.5"'';
description = ''
Whether to enable klogd, the kernel log message processing
daemon. Since systemd handles logging of kernel messages on
diff --git a/nixos/modules/services/mail/opendkim.nix b/nixos/modules/services/mail/opendkim.nix
index beff57613afc..f1ffc5d3aeef 100644
--- a/nixos/modules/services/mail/opendkim.nix
+++ b/nixos/modules/services/mail/opendkim.nix
@@ -55,6 +55,7 @@ in {
domains = mkOption {
type = types.str;
default = "csl:${config.networking.hostName}";
+ defaultText = literalExpression ''"csl:''${config.networking.hostName}"'';
example = "csl:example.com,mydomain.net";
description = ''
Local domains set (see opendkim(8) for more information on datasets).
diff --git a/nixos/modules/services/misc/etcd.nix b/nixos/modules/services/misc/etcd.nix
index c4ea091a0380..26ad1ad5536a 100644
--- a/nixos/modules/services/misc/etcd.nix
+++ b/nixos/modules/services/misc/etcd.nix
@@ -17,6 +17,7 @@ in {
name = mkOption {
description = "Etcd unique node name.";
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
type = types.str;
};
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix
index b2abe70627d0..01a7ea42d9db 100644
--- a/nixos/modules/services/misc/gitlab.nix
+++ b/nixos/modules/services/misc/gitlab.nix
@@ -475,6 +475,7 @@ in {
host = mkOption {
type = types.str;
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
description = "GitLab host name. Used e.g. for copy-paste URLs.";
};
@@ -534,6 +535,7 @@ in {
host = mkOption {
type = types.str;
default = config.services.gitlab.host;
+ defaultText = literalExpression "config.services.gitlab.host";
description = "GitLab container registry host name.";
};
port = mkOption {
diff --git a/nixos/modules/services/misc/matrix-appservice-discord.nix b/nixos/modules/services/misc/matrix-appservice-discord.nix
index c448614eca32..947471e56b46 100644
--- a/nixos/modules/services/misc/matrix-appservice-discord.nix
+++ b/nixos/modules/services/misc/matrix-appservice-discord.nix
@@ -98,6 +98,9 @@ in {
serviceDependencies = mkOption {
type = with types; listOf str;
default = optional config.services.matrix-synapse.enable "matrix-synapse.service";
+ defaultText = literalExpression ''
+ optional config.services.matrix-synapse.enable "matrix-synapse.service"
+ '';
description = ''
List of Systemd services to require and wait for when starting the application service,
such as the Matrix homeserver if it's running on the same host.
diff --git a/nixos/modules/services/misc/matrix-synapse.nix b/nixos/modules/services/misc/matrix-synapse.nix
index 950c72c6e589..0f96f6b1ee22 100644
--- a/nixos/modules/services/misc/matrix-synapse.nix
+++ b/nixos/modules/services/misc/matrix-synapse.nix
@@ -227,6 +227,7 @@ in {
type = types.str;
example = "example.com";
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
description = ''
The domain name of the server, with optional explicit port.
This is used by remote servers to look up the server address.
@@ -379,6 +380,11 @@ in {
default = if versionAtLeast config.system.stateVersion "18.03"
then "psycopg2"
else "sqlite3";
+ defaultText = literalExpression ''
+ if versionAtLeast config.system.stateVersion "18.03"
+ then "psycopg2"
+ else "sqlite3"
+ '';
description = ''
The database engine name. Can be sqlite or psycopg2.
'';
diff --git a/nixos/modules/services/misc/mautrix-telegram.nix b/nixos/modules/services/misc/mautrix-telegram.nix
index 59d0b6824090..3b070b873b04 100644
--- a/nixos/modules/services/misc/mautrix-telegram.nix
+++ b/nixos/modules/services/misc/mautrix-telegram.nix
@@ -108,6 +108,9 @@ in {
serviceDependencies = mkOption {
type = with types; listOf str;
default = optional config.services.matrix-synapse.enable "matrix-synapse.service";
+ defaultText = literalExpression ''
+ optional config.services.matrix-synapse.enable "matrix-synapse.service"
+ '';
description = ''
List of Systemd services to require and wait for when starting the application service.
'';
diff --git a/nixos/modules/services/misc/moonraker.nix b/nixos/modules/services/misc/moonraker.nix
index de8668a0c066..e08d2f84212d 100644
--- a/nixos/modules/services/misc/moonraker.nix
+++ b/nixos/modules/services/misc/moonraker.nix
@@ -18,6 +18,7 @@ in {
klipperSocket = mkOption {
type = types.path;
default = config.services.klipper.apiSocket;
+ defaultText = literalExpression "config.services.klipper.apiSocket";
description = "Path to Klipper's API socket.";
};
diff --git a/nixos/modules/services/misc/mx-puppet-discord.nix b/nixos/modules/services/misc/mx-puppet-discord.nix
index c34803f97223..a838af0da08d 100644
--- a/nixos/modules/services/misc/mx-puppet-discord.nix
+++ b/nixos/modules/services/misc/mx-puppet-discord.nix
@@ -67,6 +67,9 @@ in {
serviceDependencies = mkOption {
type = with types; listOf str;
default = optional config.services.matrix-synapse.enable "matrix-synapse.service";
+ defaultText = literalExpression ''
+ optional config.services.matrix-synapse.enable "matrix-synapse.service"
+ '';
description = ''
List of Systemd services to require and wait for when starting the application service.
'';
diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix
index 9c812d6b043c..c84a75b0ca02 100644
--- a/nixos/modules/services/misc/sourcehut/default.nix
+++ b/nixos/modules/services/misc/sourcehut/default.nix
@@ -71,6 +71,9 @@ in
originBase = mkOption {
type = types.str;
default = with config.networking; hostName + lib.optionalString (domain != null) ".${domain}";
+ defaultText = literalExpression ''
+ with config.networking; hostName + optionalString (domain != null) ".''${domain}"
+ '';
description = ''
Host name used by reverse-proxy and for default settings. Will host services at git."''${originBase}". For example: git.sr.ht
'';
diff --git a/nixos/modules/services/misc/xmrig.nix b/nixos/modules/services/misc/xmrig.nix
index cf01bb119e89..c5c3803920c8 100644
--- a/nixos/modules/services/misc/xmrig.nix
+++ b/nixos/modules/services/misc/xmrig.nix
@@ -18,6 +18,7 @@ with lib;
package = mkOption {
type = types.package;
default = pkgs.xmrig;
+ defaultText = literalExpression "pkgs.xmrig";
example = literalExpression "pkgs.xmrig-mo";
description = "XMRig package to use.";
};
diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix
index 4690a252c925..0dbb33530c92 100644
--- a/nixos/modules/services/monitoring/graphite.nix
+++ b/nixos/modules/services/monitoring/graphite.nix
@@ -324,6 +324,7 @@ in {
mongoUrl = mkOption {
default = "mongodb://${config.services.mongodb.bind_ip}:27017/seyren";
+ defaultText = literalExpression ''"mongodb://''${config.services.mongodb.bind_ip}:27017/seyren"'';
description = "Mongodb connection string.";
type = types.str;
};
diff --git a/nixos/modules/services/monitoring/nagios.nix b/nixos/modules/services/monitoring/nagios.nix
index 83020d52fc82..2c7f0ed19668 100644
--- a/nixos/modules/services/monitoring/nagios.nix
+++ b/nixos/modules/services/monitoring/nagios.nix
@@ -131,6 +131,7 @@ in
validateConfig = mkOption {
type = types.bool;
default = pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform;
+ defaultText = literalExpression "pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform";
description = "if true, the syntax of the nagios configuration file is checked at build time";
};
diff --git a/nixos/modules/services/monitoring/parsedmarc.nix b/nixos/modules/services/monitoring/parsedmarc.nix
index eeee04b4400c..8571e1f01ed6 100644
--- a/nixos/modules/services/monitoring/parsedmarc.nix
+++ b/nixos/modules/services/monitoring/parsedmarc.nix
@@ -93,6 +93,7 @@ in
dashboard = lib.mkOption {
type = lib.types.bool;
default = config.services.grafana.enable;
+ defaultText = lib.literalExpression "config.services.grafana.enable";
description = ''
Whether the official parsedmarc grafana dashboard should
be provisioned to the local grafana instance.
diff --git a/nixos/modules/services/monitoring/smartd.nix b/nixos/modules/services/monitoring/smartd.nix
index 3ea254371142..73021b1b4d38 100644
--- a/nixos/modules/services/monitoring/smartd.nix
+++ b/nixos/modules/services/monitoring/smartd.nix
@@ -125,6 +125,7 @@ in
mail = {
enable = mkOption {
default = config.services.mail.sendmailSetuidWrapper != null;
+ defaultText = literalExpression "config.services.mail.sendmailSetuidWrapper != null";
type = types.bool;
description = "Whenever to send e-mail notifications.";
};
@@ -169,12 +170,14 @@ in
x11 = {
enable = mkOption {
default = config.services.xserver.enable;
+ defaultText = literalExpression "config.services.xserver.enable";
type = types.bool;
description = "Whenever to send X11 xmessage notifications.";
};
display = mkOption {
default = ":${toString config.services.xserver.display}";
+ defaultText = literalExpression ''":''${toString config.services.xserver.display}"'';
type = types.str;
description = "DISPLAY to send X11 notifications to.";
};
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index 36b72ca48b2c..5482b2aaf88c 100644
--- a/nixos/modules/services/network-filesystems/ipfs.nix
+++ b/nixos/modules/services/network-filesystems/ipfs.nix
@@ -79,6 +79,11 @@ in
if versionAtLeast config.system.stateVersion "17.09"
then "/var/lib/ipfs"
else "/var/lib/ipfs/.ipfs";
+ defaultText = literalExpression ''
+ if versionAtLeast config.system.stateVersion "17.09"
+ then "/var/lib/ipfs"
+ else "/var/lib/ipfs/.ipfs"
+ '';
description = "The data dir for IPFS";
};
diff --git a/nixos/modules/services/networking/bind.nix b/nixos/modules/services/networking/bind.nix
index f2b2e4c4d5d4..e44f8d4cf302 100644
--- a/nixos/modules/services/networking/bind.nix
+++ b/nixos/modules/services/networking/bind.nix
@@ -144,6 +144,7 @@ in
forwarders = mkOption {
default = config.networking.nameservers;
+ defaultText = literalExpression "config.networking.nameservers";
type = types.listOf types.str;
description = "
List of servers we should forward requests to.
diff --git a/nixos/modules/services/networking/coturn.nix b/nixos/modules/services/networking/coturn.nix
index 610754e9bd39..ce563c31136f 100644
--- a/nixos/modules/services/networking/coturn.nix
+++ b/nixos/modules/services/networking/coturn.nix
@@ -193,6 +193,7 @@ in {
realm = mkOption {
type = types.str;
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
example = "example.com";
description = ''
The default realm to be used for the users when no explicit
diff --git a/nixos/modules/services/networking/dnscrypt-wrapper.nix b/nixos/modules/services/networking/dnscrypt-wrapper.nix
index 400d6e67044e..c2add170e9cc 100644
--- a/nixos/modules/services/networking/dnscrypt-wrapper.nix
+++ b/nixos/modules/services/networking/dnscrypt-wrapper.nix
@@ -145,6 +145,7 @@ in {
providerName = mkOption {
type = types.str;
default = "2.dnscrypt-cert.${config.networking.hostName}";
+ defaultText = literalExpression ''"2.dnscrypt-cert.''${config.networking.hostName}"'';
example = "2.dnscrypt-cert.myresolver";
description = ''
The name that will be given to this DNSCrypt resolver.
diff --git a/nixos/modules/services/networking/flannel.nix b/nixos/modules/services/networking/flannel.nix
index b15339870ee2..ac84b3d35a3d 100644
--- a/nixos/modules/services/networking/flannel.nix
+++ b/nixos/modules/services/networking/flannel.nix
@@ -93,6 +93,9 @@ in {
'';
type = types.nullOr types.str;
default = with config.networking; (hostName + optionalString (domain != null) ".${domain}");
+ defaultText = literalExpression ''
+ with config.networking; (hostName + optionalString (domain != null) ".''${domain}")
+ '';
example = "node1.example.com";
};
diff --git a/nixos/modules/services/networking/ncdns.nix b/nixos/modules/services/networking/ncdns.nix
index af17fc0814b2..82c285d05160 100644
--- a/nixos/modules/services/networking/ncdns.nix
+++ b/nixos/modules/services/networking/ncdns.nix
@@ -76,6 +76,7 @@ in
identity.hostname = mkOption {
type = types.str;
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
example = "example.com";
description = ''
The hostname of this ncdns instance, which defaults to the machine
diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix
index 893995165b9e..cf6c9661dc1b 100644
--- a/nixos/modules/services/networking/nsd.nix
+++ b/nixos/modules/services/networking/nsd.nix
@@ -603,6 +603,7 @@ in
reuseport = mkOption {
type = types.bool;
default = pkgs.stdenv.isLinux;
+ defaultText = literalExpression "pkgs.stdenv.isLinux";
description = ''
Whether to enable SO_REUSEPORT on all used sockets. This lets multiple
processes bind to the same port. This speeds up operation especially
diff --git a/nixos/modules/services/networking/ntp/chrony.nix b/nixos/modules/services/networking/ntp/chrony.nix
index d414936a2c2b..34728455a212 100644
--- a/nixos/modules/services/networking/ntp/chrony.nix
+++ b/nixos/modules/services/networking/ntp/chrony.nix
@@ -52,6 +52,7 @@ in
servers = mkOption {
default = config.networking.timeServers;
+ defaultText = literalExpression "config.networking.timeServers";
type = types.listOf types.str;
description = ''
The set of NTP servers from which to synchronise.
diff --git a/nixos/modules/services/networking/ntp/ntpd.nix b/nixos/modules/services/networking/ntp/ntpd.nix
index ce4802ce0245..12be0d045a85 100644
--- a/nixos/modules/services/networking/ntp/ntpd.nix
+++ b/nixos/modules/services/networking/ntp/ntpd.nix
@@ -77,6 +77,7 @@ in
servers = mkOption {
default = config.networking.timeServers;
+ defaultText = literalExpression "config.networking.timeServers";
type = types.listOf types.str;
description = ''
The set of NTP servers from which to synchronise.
diff --git a/nixos/modules/services/networking/ntp/openntpd.nix b/nixos/modules/services/networking/ntp/openntpd.nix
index 9f3892e3b538..e86b71291f96 100644
--- a/nixos/modules/services/networking/ntp/openntpd.nix
+++ b/nixos/modules/services/networking/ntp/openntpd.nix
@@ -23,6 +23,7 @@ in
servers = mkOption {
default = config.services.ntp.servers;
+ defaultText = literalExpression "config.services.ntp.servers";
type = types.listOf types.str;
inherit (options.services.ntp.servers) description;
};
diff --git a/nixos/modules/services/networking/resilio.nix b/nixos/modules/services/networking/resilio.nix
index 4701b0e8143d..891278506417 100644
--- a/nixos/modules/services/networking/resilio.nix
+++ b/nixos/modules/services/networking/resilio.nix
@@ -58,6 +58,7 @@ in
type = types.str;
example = "Voltron";
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
description = ''
Name of the Resilio Sync device.
'';
diff --git a/nixos/modules/services/networking/seafile.nix b/nixos/modules/services/networking/seafile.nix
index 856797b6b020..d7fb22edebed 100644
--- a/nixos/modules/services/networking/seafile.nix
+++ b/nixos/modules/services/networking/seafile.nix
@@ -124,6 +124,7 @@ in {
type = types.package;
description = "Which package to use for the seafile server.";
default = pkgs.seafile-server;
+ defaultText = literalExpression "pkgs.seafile-server";
};
seahubExtraConf = mkOption {
diff --git a/nixos/modules/services/networking/skydns.nix b/nixos/modules/services/networking/skydns.nix
index c4e959b57bbe..dea60a3862a3 100644
--- a/nixos/modules/services/networking/skydns.nix
+++ b/nixos/modules/services/networking/skydns.nix
@@ -49,6 +49,7 @@ in {
nameservers = mkOption {
default = map (n: n + ":53") config.networking.nameservers;
+ defaultText = literalExpression ''map (n: n + ":53") config.networking.nameservers'';
type = types.listOf types.str;
description = "Skydns list of nameservers to forward DNS requests to when not authoritative for a domain.";
example = ["8.8.8.8:53" "8.8.4.4:53"];
diff --git a/nixos/modules/services/networking/smokeping.nix b/nixos/modules/services/networking/smokeping.nix
index c075cbbceac9..bd71b158dbe3 100644
--- a/nixos/modules/services/networking/smokeping.nix
+++ b/nixos/modules/services/networking/smokeping.nix
@@ -241,6 +241,12 @@ in
+ FPing
binary = ${config.security.wrapperDir}/fping
'';
+ defaultText = literalExpression ''
+ '''
+ + FPing
+ binary = ''${config.security.wrapperDir}/fping
+ '''
+ '';
description = "Probe configuration";
};
sendmail = mkOption {
diff --git a/nixos/modules/services/networking/soju.nix b/nixos/modules/services/networking/soju.nix
index 68a33e9dccba..cb0acf4765ff 100644
--- a/nixos/modules/services/networking/soju.nix
+++ b/nixos/modules/services/networking/soju.nix
@@ -43,6 +43,7 @@ in
hostName = mkOption {
type = types.str;
default = config.networking.hostName;
+ defaultText = literalExpression "config.networking.hostName";
description = "Server hostname.";
};
diff --git a/nixos/modules/services/security/oauth2_proxy_nginx.nix b/nixos/modules/services/security/oauth2_proxy_nginx.nix
index d82ddb894ea5..5853c5a123c6 100644
--- a/nixos/modules/services/security/oauth2_proxy_nginx.nix
+++ b/nixos/modules/services/security/oauth2_proxy_nginx.nix
@@ -8,6 +8,7 @@ in
proxy = mkOption {
type = types.str;
default = config.services.oauth2_proxy.httpAddress;
+ defaultText = literalExpression "config.services.oauth2_proxy.httpAddress";
description = ''
The address of the reverse proxy endpoint for oauth2_proxy
'';
diff --git a/nixos/modules/services/security/torsocks.nix b/nixos/modules/services/security/torsocks.nix
index 47ac95c4626e..fdd6ac32cc66 100644
--- a/nixos/modules/services/security/torsocks.nix
+++ b/nixos/modules/services/security/torsocks.nix
@@ -37,6 +37,7 @@ in
enable = mkOption {
type = types.bool;
default = config.services.tor.enable && config.services.tor.client.enable;
+ defaultText = literalExpression "config.services.tor.enable && config.services.tor.client.enable";
description = ''
Whether to build /etc/tor/torsocks.conf
containing the specified global torsocks configuration.
diff --git a/nixos/modules/services/web-apps/ihatemoney/default.nix b/nixos/modules/services/web-apps/ihatemoney/default.nix
index 238241854c1c..ad314c885ba8 100644
--- a/nixos/modules/services/web-apps/ihatemoney/default.nix
+++ b/nixos/modules/services/web-apps/ihatemoney/default.nix
@@ -79,6 +79,7 @@ in
email = mkOption {
type = types.str;
default = "ihatemoney@${config.networking.hostName}";
+ defaultText = literalExpression ''"ihatemoney@''${config.networking.hostName}"'';
description = "The email of the sender of ihatemoney emails";
};
};
diff --git a/nixos/modules/services/web-apps/openwebrx.nix b/nixos/modules/services/web-apps/openwebrx.nix
index 51005cd1e497..9e90c01e0bbb 100644
--- a/nixos/modules/services/web-apps/openwebrx.nix
+++ b/nixos/modules/services/web-apps/openwebrx.nix
@@ -9,6 +9,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.openwebrx;
+ defaultText = literalExpression "pkgs.openwebrx";
description = "OpenWebRX package to use for the service";
};
};
diff --git a/nixos/modules/services/web-apps/peertube.nix b/nixos/modules/services/web-apps/peertube.nix
index 362a3358b793..932ddcfef198 100644
--- a/nixos/modules/services/web-apps/peertube.nix
+++ b/nixos/modules/services/web-apps/peertube.nix
@@ -234,6 +234,7 @@ in {
package = lib.mkOption {
type = lib.types.package;
default = pkgs.peertube;
+ defaultText = lib.literalExpression "pkgs.peertube";
description = "Peertube package to use.";
};
};
diff --git a/nixos/modules/services/web-servers/varnish/default.nix b/nixos/modules/services/web-servers/varnish/default.nix
index 0ebf58eb9f61..fe817313a993 100644
--- a/nixos/modules/services/web-servers/varnish/default.nix
+++ b/nixos/modules/services/web-servers/varnish/default.nix
@@ -42,6 +42,7 @@ in
stateDir = mkOption {
type = types.path;
default = "/var/spool/varnish/${config.networking.hostName}";
+ defaultText = literalExpression ''"/var/spool/varnish/''${config.networking.hostName}"'';
description = "
Directory holding all state for Varnish to run.
";
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index b04577aeb83e..58377ea64438 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -201,6 +201,7 @@ in
system.boot.loader.kernelFile = mkOption {
internal = true;
default = pkgs.stdenv.hostPlatform.linux-kernel.target;
+ defaultText = literalExpression "pkgs.stdenv.hostPlatform.linux-kernel.target";
type = types.str;
description = ''
Name of the kernel file to be passed to the bootloader.
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index fa8500dd42bd..8db271f87135 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -99,6 +99,7 @@ in
enable = mkOption {
default = !config.boot.isContainer;
+ defaultText = literalExpression "!config.boot.isContainer";
type = types.bool;
description = ''
Whether to enable the GNU GRUB boot loader.
diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix
index a6fc07da0abb..21d3fab2f35d 100644
--- a/nixos/modules/system/boot/resolved.nix
+++ b/nixos/modules/system/boot/resolved.nix
@@ -32,6 +32,7 @@ in
services.resolved.domains = mkOption {
default = config.networking.search;
+ defaultText = literalExpression "config.networking.search";
example = [ "example.com" ];
type = types.listOf types.str;
description = ''
diff --git a/nixos/modules/system/boot/timesyncd.nix b/nixos/modules/system/boot/timesyncd.nix
index 692315dbe99c..5f35a1547696 100644
--- a/nixos/modules/system/boot/timesyncd.nix
+++ b/nixos/modules/system/boot/timesyncd.nix
@@ -9,6 +9,7 @@ with lib;
services.timesyncd = {
enable = mkOption {
default = !config.boot.isContainer;
+ defaultText = literalExpression "!config.boot.isContainer";
type = types.bool;
description = ''
Enables the systemd NTP client daemon.
@@ -16,6 +17,7 @@ with lib;
};
servers = mkOption {
default = config.networking.timeServers;
+ defaultText = literalExpression "config.networking.timeServers";
type = types.listOf types.str;
description = ''
The set of NTP servers from which to synchronise.
diff --git a/nixos/modules/virtualisation/amazon-options.nix b/nixos/modules/virtualisation/amazon-options.nix
index 698edcd835a6..0465571ca926 100644
--- a/nixos/modules/virtualisation/amazon-options.nix
+++ b/nixos/modules/virtualisation/amazon-options.nix
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
let
- inherit (lib) types;
+ inherit (lib) literalExpression types;
in {
options = {
ec2 = {
@@ -50,6 +50,7 @@ in {
};
efi = lib.mkOption {
default = pkgs.stdenv.hostPlatform.isAarch64;
+ defaultText = literalExpression "pkgs.stdenv.hostPlatform.isAarch64";
internal = true;
description = ''
Whether the EC2 instance is using EFI.
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 91356ac1d984..c7c3d7474645 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -329,6 +329,7 @@ in
mkOption {
type = types.str;
default = "./${config.system.name}.qcow2";
+ defaultText = literalExpression ''"./''${config.system.name}.qcow2"'';
description =
''
Path to the disk image containing the root filesystem.
@@ -678,6 +679,7 @@ in
mkOption {
type = types.str;
default = "./${config.system.name}-efi-vars.fd";
+ defaultText = literalExpression ''"./''${config.system.name}-efi-vars.fd"'';
description =
''
Path to nvram image containing UEFI variables. The will be created