changed nix options

This commit is contained in:
Kristian Krsnik 2023-10-04 19:03:31 +02:00
parent b53e982317
commit 987cc3cc71
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85

View File

@ -21,19 +21,8 @@ in {
};
settings = mkOption {
type = with types; let
valueType = nullOr (oneOf [
# TODO: restrict type to actual config file structure
bool
int
float
str
path
(attrsOf valueType)
(listOf valueType)
]);
in
valueType;
type = with types; attrsOf (either str int);
default = {
logFile = throw "Please specify outage-detector.settings.";
host = "1.1.1.1";
@ -47,7 +36,7 @@ in {
systemd.services.outage-detector = mkIf (cfg.timer
!= null) {
script = "${package}/bin/outage_detector log ${cfg.settings.logFile} --host ${cfg.settings.host} --timeout ${cfg.settings.timeout}";
script = "${package}/bin/outage_detector log ${cfg.settings.logFile} --host ${cfg.settings.host} --timeout ${toString cfg.settings.timeout}";
serviceConfig = {
Type = "oneshot";