missing defaults

This commit is contained in:
ari committed 2026-07-01 18:07:52 -04:00
1 parent 3cb0b970bf
commit 5242850fbc
3 files changed
+27 -5

No files matched your search

+7 -1
View File
@@ -10,11 +10,17 @@ in
options.skyg.nixos.common.hardware.fancontrol = with lib; {
enable = mkEnableOption "fancontrol";
configName = mkOption {
type = types.str;
type = types.nullOr types.str;
default = null;
example = "thinkpad";
};
};
config = lib.mkIf cfg.enable {
assertions = [{
assertion = cfg.configName != null; # only checked when enable = true
message = "skyg.nixos.common.hardware.fancontrol: configName must be set when fancontrol is enabled";
}];
systemd.services.fancontrol = {
enable = true;
description = "Fan control";
+16 -2
View File
@@ -16,10 +16,14 @@ in
isNode = lib.mkEnableOption
"Enable as node";
masterIP = lib.mkOption {
type = lib.types.str;
type = lib.types.nullOr lib.types.str;
default = null;
example = "10.0.0.1";
};
masterHostName = lib.mkOption {
type = lib.types.str;
type = lib.types.nullOr lib.types.str;
default = null;
example = "k8s-master";
};
masterAPIPort = lib.mkOption {
type = lib.types.number;
@@ -41,6 +45,16 @@ in
];
in
lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.masterIP != null;
message = "skyg.nixos.server.k8s: masterIP must be set when k8s is enabled";
}
{
assertion = cfg.masterHostName != null;
message = "skyg.nixos.server.k8s: masterHostName must be set when k8s is enabled";
}
];
# resolve master hostname
networking.extraHosts = "${cfg.masterIP} ${cfg.masterHostName}";
networking.firewall.allowedUDPPorts = ports;
@@ -14,18 +14,20 @@ in {
configDir = mkOption {
description =
"Path to Audiobookshelf config folder";
default = "${cfg.dataDir}/config";
type = types.str;
};
dataDir = mkOption {
description = "Path to Audiobookshelf config and metadata inside of /var/lib.";
default = "audiobookshelf";
default = "/var/lib/audiobookshelf";
type = types.str;
};
metadataDir = mkOption {
description =
"Path to Audiobookshelf config folder";
"Path to Audiobookshelf metadata folder";
default = "${cfg.dataDir}/metadata";
type = types.str;
};