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 {
type = types.nullOr types.str;
default = config.vacu.hostName;
defaultText = "{option}`vacu.hostName`";
};
vacu.vnopnCA = mkOption {
readOnly = true;

View File

@@ -12,6 +12,7 @@ lib.optionalAttrs (vacuModuleType == "nixos") {
options.vacu.enableCapsLockRemap = mkOption {
type = types.bool;
default = config.vacu.isGui;
defaultText = "{option}`vacu.isGui`";
};
config = lib.mkIf config.vacu.enableCapsLockRemap {
# 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 {
type = types.package;
default = pkgs.units.override { enableCurrenciesUpdater = false; };
defaultText = "pkgs.units.override { ... }";
};
finalPackage = mkOption {
type = types.package;

View File

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

View File

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

View File

@@ -53,10 +53,22 @@ in
options.vacu.liam.backup = {
user = mkOption { default = "autoborger"; };
rsyncUser = mkOption { default = "fm2382"; };
rsyncHost = mkOption { default = "${cfg.rsyncUser}.rsync.net"; };
repo = mkOption { default = "${cfg.rsyncUser}@${cfg.rsyncHost}:borg-repos/liam-backup"; };
package = mkOption { default = pkgs.borgbackup; };
cmd = mkOption { default = lib.getExe cfg.package; };
rsyncHost = mkOption {
default = "${cfg.rsyncUser}.rsync.net";
defaultText = "(output)";
};
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 {
default = [
"/var/lib/mail"
@@ -64,7 +76,10 @@ in
"/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 = {
vacu.assertions = lib.singleton {

View File

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

View File

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

View File

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

View File

@@ -48,6 +48,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.hentai-at-home;
defaultText = "´pkgs.hentai-at-home`";
};
user = mkOption {
type = types.passwdEntry types.str;
@@ -65,7 +66,8 @@ in
};
allowPrivilegedPort = mkOption {
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 {
type = types.nullOr credentialsType;

View File

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

View File

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

View File

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

View File

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

View File

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