nixos/services.prometheus.alertmanagerWebhookLogger: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:47:01 +02:00
parent c617a4cb83
commit 951787fba3

View File

@ -1,24 +1,21 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.prometheus.alertmanagerWebhookLogger;
in
{
options.services.prometheus.alertmanagerWebhookLogger = {
enable = mkEnableOption "Alertmanager Webhook Logger";
enable = lib.mkEnableOption "Alertmanager Webhook Logger";
package = mkPackageOption pkgs "alertmanager-webhook-logger" { };
package = lib.mkPackageOption pkgs "alertmanager-webhook-logger" { };
extraFlags = mkOption {
type = types.listOf types.str;
extraFlags = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Extra command line options to pass to alertmanager-webhook-logger.";
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.services.alertmanager-webhook-logger = {
description = "Alertmanager Webhook Logger";
@ -29,7 +26,7 @@ in
serviceConfig = {
ExecStart = ''
${cfg.package}/bin/alertmanager-webhook-logger \
${escapeShellArgs cfg.extraFlags}
${lib.escapeShellArgs cfg.extraFlags}
'';
CapabilityBoundingSet = [ "" ];
@ -77,5 +74,5 @@ in
};
};
meta.maintainers = [ maintainers.jpds ];
meta.maintainers = [ lib.maintainers.jpds ];
}