mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/services.prometheus.alertmanagerWebhookLogger: remove with lib;
This commit is contained in:
parent
c617a4cb83
commit
951787fba3
1 changed files with 7 additions and 10 deletions
|
@ -1,24 +1,21 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.alertmanagerWebhookLogger;
|
cfg = config.services.prometheus.alertmanagerWebhookLogger;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.prometheus.alertmanagerWebhookLogger = {
|
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 {
|
extraFlags = lib.mkOption {
|
||||||
type = types.listOf types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Extra command line options to pass to alertmanager-webhook-logger.";
|
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 = {
|
systemd.services.alertmanager-webhook-logger = {
|
||||||
description = "Alertmanager Webhook Logger";
|
description = "Alertmanager Webhook Logger";
|
||||||
|
|
||||||
|
@ -29,7 +26,7 @@ in
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = ''
|
ExecStart = ''
|
||||||
${cfg.package}/bin/alertmanager-webhook-logger \
|
${cfg.package}/bin/alertmanager-webhook-logger \
|
||||||
${escapeShellArgs cfg.extraFlags}
|
${lib.escapeShellArgs cfg.extraFlags}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
CapabilityBoundingSet = [ "" ];
|
CapabilityBoundingSet = [ "" ];
|
||||||
|
@ -77,5 +74,5 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
meta.maintainers = [ maintainers.jpds ];
|
meta.maintainers = [ lib.maintainers.jpds ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue