diff --git a/nix/module.nix b/nix/module.nix index b48ec67..0caeb1b 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -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";