diff --git a/nixos/modules/services/monitoring/prometheus/sachet.nix b/nixos/modules/services/monitoring/prometheus/sachet.nix index 3deb29aeb222..bc1416308f16 100644 --- a/nixos/modules/services/monitoring/prometheus/sachet.nix +++ b/nixos/modules/services/monitoring/prometheus/sachet.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.prometheus.sachet; configFile = pkgs.writeText "sachet.yml" (builtins.toJSON cfg.configuration); @@ -9,12 +6,12 @@ in { options = { services.prometheus.sachet = { - enable = mkEnableOption "Sachet, an SMS alerting tool for the Prometheus Alertmanager"; + enable = lib.mkEnableOption "Sachet, an SMS alerting tool for the Prometheus Alertmanager"; - configuration = mkOption { - type = types.nullOr types.attrs; + configuration = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; default = null; - example = literalExpression '' + example = lib.literalExpression '' { providers = { twilio = { @@ -37,16 +34,16 @@ in ''; }; - address = mkOption { - type = types.str; + address = lib.mkOption { + type = lib.types.str; default = "localhost"; description = '' The address Sachet will listen to. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 9876; description = '' The port Sachet will listen to. @@ -56,8 +53,8 @@ in }; }; - config = mkIf cfg.enable { - assertions = singleton { + config = lib.mkIf cfg.enable { + assertions = lib.singleton { assertion = cfg.configuration != null; message = "Cannot enable Sachet without a configuration."; };