From 987cc3cc71e185264e90d5a8352f6d6e69938698 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Wed, 4 Oct 2023 19:03:31 +0200 Subject: [PATCH] changed nix options --- nix/module.nix | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) 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";