mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
nixos/services.prometheus.sachet: remove with lib;
This commit is contained in:
parent
3b6ddc5927
commit
f9825ae100
@ -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.";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user