add defaultText for every non-trivial default= in a mkOption

This commit is contained in:
Shelvacu
2025-07-21 19:03:13 -07:00
committed by Shelvacu on nix-on-droid
parent ca7d074438
commit 053bf4d7b3
15 changed files with 40 additions and 9 deletions

View File

@@ -64,6 +64,7 @@ else
vacu.shortHostName = mkOption { vacu.shortHostName = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = config.vacu.hostName; default = config.vacu.hostName;
defaultText = "{option}`vacu.hostName`";
}; };
vacu.vnopnCA = mkOption { vacu.vnopnCA = mkOption {
readOnly = true; readOnly = true;

View File

@@ -12,6 +12,7 @@ lib.optionalAttrs (vacuModuleType == "nixos") {
options.vacu.enableCapsLockRemap = mkOption { options.vacu.enableCapsLockRemap = mkOption {
type = types.bool; type = types.bool;
default = config.vacu.isGui; default = config.vacu.isGui;
defaultText = "{option}`vacu.isGui`";
}; };
config = lib.mkIf config.vacu.enableCapsLockRemap { config = lib.mkIf config.vacu.enableCapsLockRemap {
# https://discourse.nixos.org/t/best-way-to-remap-caps-lock-to-esc-with-wayland/39707/6 # https://discourse.nixos.org/t/best-way-to-remap-caps-lock-to-esc-with-wayland/39707/6

View File

@@ -49,6 +49,7 @@ in
originalPackage = mkOption { originalPackage = mkOption {
type = types.package; type = types.package;
default = pkgs.units.override { enableCurrenciesUpdater = false; }; default = pkgs.units.override { enableCurrenciesUpdater = false; };
defaultText = "pkgs.units.override { ... }";
}; };
finalPackage = mkOption { finalPackage = mkOption {
type = types.package; type = types.package;

View File

@@ -29,6 +29,7 @@ in
script = mkOption { script = mkOption {
type = types.lines; type = types.lines;
default = "## system ident check ${config.name}"; default = "## system ident check ${config.name}";
defaultText = lib.literalText ''## system ident check ${name}'';
}; };
}; };
} }
@@ -56,6 +57,7 @@ in
mkOption { mkOption {
readOnly = true; readOnly = true;
default = scriptFile; default = scriptFile;
defaultText = "vacu-verify-system-all.sh package";
}; };
}; };
} }

View File

@@ -10,6 +10,7 @@
options.vacu.secretsFolder = lib.mkOption { options.vacu.secretsFolder = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = ../secrets; default = ../secrets;
defaultText = "<nix-stuff>/secrets";
}; };
config = { config = {

View File

@@ -53,10 +53,22 @@ in
options.vacu.liam.backup = { options.vacu.liam.backup = {
user = mkOption { default = "autoborger"; }; user = mkOption { default = "autoborger"; };
rsyncUser = mkOption { default = "fm2382"; }; rsyncUser = mkOption { default = "fm2382"; };
rsyncHost = mkOption { default = "${cfg.rsyncUser}.rsync.net"; }; rsyncHost = mkOption {
repo = mkOption { default = "${cfg.rsyncUser}@${cfg.rsyncHost}:borg-repos/liam-backup"; }; default = "${cfg.rsyncUser}.rsync.net";
package = mkOption { default = pkgs.borgbackup; }; defaultText = "(output)";
cmd = mkOption { default = lib.getExe cfg.package; }; };
repo = mkOption {
default = "${cfg.rsyncUser}@${cfg.rsyncHost}:borg-repos/liam-backup";
defaultText = "(output)";
};
package = mkOption {
default = pkgs.borgbackup;
defaultText = "pkgs.borgbackup";
};
cmd = mkOption {
default = lib.getExe cfg.package;
defaultText = "lib.getExe cfg.package";
};
paths = mkOption { paths = mkOption {
default = [ default = [
"/var/lib/mail" "/var/lib/mail"
@@ -64,7 +76,10 @@ in
"/var/log" "/var/log"
]; ];
}; };
keyPath = mkOption { default = config.sops.secrets.liam-borg-key.path; }; keyPath = mkOption {
default = config.sops.secrets.liam-borg-key.path;
defaultText = "TODO";
};
}; };
config = { config = {
vacu.assertions = lib.singleton { vacu.assertions = lib.singleton {

View File

@@ -926,10 +926,12 @@ in
"/dev/null" "/dev/null"
]} ]}
''; '';
defaultText = "check-liam-sieve package";
}; };
options.vacu.liam-sieve-script = lib.mkOption { options.vacu.liam-sieve-script = lib.mkOption {
readOnly = true; readOnly = true;
default = pkgs.writeText "mainsieve" sieve_text; default = pkgs.writeText "mainsieve" sieve_text;
defaultText = "mainsieve text package";
}; };
config = { config = {
vacu.packages = [ pigeonhole_pkg ]; vacu.packages = [ pigeonhole_pkg ];

View File

@@ -10,6 +10,7 @@
options.vacu.secretsFolder = lib.mkOption { options.vacu.secretsFolder = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = ../secrets; default = ../secrets;
defaultText = "<nix-stuff>/secrets";
}; };
config.sops = { config.sops = {

View File

@@ -69,6 +69,7 @@ in
readOnly = true; readOnly = true;
type = types.str; type = types.str;
default = lib.concatMapStringsSep "\n" lib.generators.toGitINI cfg.config; default = lib.concatMapStringsSep "\n" lib.generators.toGitINI cfg.config;
defaultText = "(output config)";
}; };
}; };

View File

@@ -48,6 +48,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.hentai-at-home; default = pkgs.hentai-at-home;
defaultText = "´pkgs.hentai-at-home`";
}; };
user = mkOption { user = mkOption {
type = types.passwdEntry types.str; type = types.passwdEntry types.str;
@@ -65,7 +66,8 @@ in
}; };
allowPrivilegedPort = mkOption { allowPrivilegedPort = mkOption {
type = types.bool; type = types.bool;
default = if cfg.port == null then true else cfg.port < 1024; default = cfg.port == null || cfg.port < 1024;
defaultText = "`cfg.port == null || cfg.port < 1024`";
}; };
credentials = mkOption { credentials = mkOption {
type = types.nullOr credentialsType; type = types.nullOr credentialsType;

View File

@@ -70,6 +70,7 @@ in
type = types.str; type = types.str;
readOnly = true; readOnly = true;
default = etcHostsText; default = etcHostsText;
defaultText = "(output)";
}; };
}; };
config = config =

View File

@@ -427,6 +427,7 @@ in
options.tf2 = { options.tf2 = {
tf2Pkgs = mkOption { tf2Pkgs = mkOption {
default = tf2Pkgs; default = tf2Pkgs;
defaultText = "`inputs.tf2-nix.lib.mkTf2Pkgs { ... }`";
readOnly = true; readOnly = true;
}; };
binds = binds =
@@ -461,20 +462,20 @@ in
); );
build.autoexec = mkOption { build.autoexec = mkOption {
type = types.pkg; type = types.pkg;
default = pkgs.writeFile "autoexec.cfg" cfg.autoexecLines;
readOnly = true; readOnly = true;
}; };
build.classes = mkAttrsOfClasses ( build.classes = mkAttrsOfClasses (
classname: classname:
mkOption { mkOption {
type = types.pkg; type = types.pkg;
default = pkgs.writeText "${classname}.cfg" cfg.classLines.${classname};
reaonly = true; reaonly = true;
} }
); );
}; };
config.tf2 = { config.tf2 = {
build.autoexec = pkgs.writeFile "autoexec.cfg" cfg.autoexecLines;
build.classes = mkAttrsOfClasses (classname: pkgs.writeText "${classname}.cfg" cfg.classLines.${classname});
autoexecLines = lib.mkMerge ( autoexecLines = lib.mkMerge (
[ [
'' ''

View File

@@ -6,7 +6,6 @@
}: }:
let let
inherit (lib) inherit (lib)
mkEnableOption
mkOption mkOption
types types
flip flip
@@ -84,6 +83,7 @@ let
internal = true; internal = true;
readOnly = true; readOnly = true;
default = environmentVars // config.extraEnv; default = environmentVars // config.extraEnv;
defaultText = "internal";
}; };
}; };
}; };

View File

@@ -10,6 +10,7 @@
options.vacu.secretsFolder = lib.mkOption { options.vacu.secretsFolder = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = ../secrets; default = ../secrets;
defaultText = "<nix-stuff>/secrets";
}; };
config.sops = { config.sops = {

View File

@@ -10,6 +10,7 @@
options.vacu.secretsFolder = lib.mkOption { options.vacu.secretsFolder = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = ../secrets; default = ../secrets;
defaultText = "<nix-stuff>/secrets";
}; };
config = { config = {