add defaultText for every non-trivial default= in a mkOption
This commit is contained in:

committed by
Shelvacu on nix-on-droid

parent
ca7d074438
commit
053bf4d7b3
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@
|
||||
options.vacu.secretsFolder = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = ../secrets;
|
||||
defaultText = "<nix-stuff>/secrets";
|
||||
};
|
||||
|
||||
config = {
|
||||
|
@@ -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 {
|
||||
|
@@ -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 ];
|
||||
|
@@ -10,6 +10,7 @@
|
||||
options.vacu.secretsFolder = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = ../secrets;
|
||||
defaultText = "<nix-stuff>/secrets";
|
||||
};
|
||||
|
||||
config.sops = {
|
||||
|
@@ -69,6 +69,7 @@ in
|
||||
readOnly = true;
|
||||
type = types.str;
|
||||
default = lib.concatMapStringsSep "\n" lib.generators.toGitINI cfg.config;
|
||||
defaultText = "(output config)";
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -70,6 +70,7 @@ in
|
||||
type = types.str;
|
||||
readOnly = true;
|
||||
default = etcHostsText;
|
||||
defaultText = "(output)";
|
||||
};
|
||||
};
|
||||
config =
|
||||
|
@@ -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 (
|
||||
[
|
||||
''
|
||||
|
@@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@@ -10,6 +10,7 @@
|
||||
options.vacu.secretsFolder = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = ../secrets;
|
||||
defaultText = "<nix-stuff>/secrets";
|
||||
};
|
||||
|
||||
config.sops = {
|
||||
|
@@ -10,6 +10,7 @@
|
||||
options.vacu.secretsFolder = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = ../secrets;
|
||||
defaultText = "<nix-stuff>/secrets";
|
||||
};
|
||||
|
||||
config = {
|
||||
|
Reference in New Issue
Block a user