mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
49 lines
1.3 KiB
Nix
49 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
}:
|
|
|
|
let
|
|
tempReadingOptions = {
|
|
options = {
|
|
label = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
description = "Friendly label of the reading.";
|
|
};
|
|
enabled = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Whether this reading is enabled.";
|
|
};
|
|
warningTemp = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.numbers.positive;
|
|
default = null;
|
|
description = "Warning temperature threshold.";
|
|
};
|
|
criticalTemp = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.numbers.positive;
|
|
default = null;
|
|
description = "Critical temperature threshold.";
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
name = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
description = "Friendly name of the sensor.";
|
|
};
|
|
enabled = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Whether sensor is enabled.";
|
|
};
|
|
readings = lib.mkOption {
|
|
type = lib.types.attrsOf (lib.types.submodule tempReadingOptions);
|
|
default = { };
|
|
description = "Overrides for specific readings of the sensor, by label.";
|
|
};
|
|
};
|
|
}
|