Fix telegraf module

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-03-07 23:36:15 +01:00
parent dd2a8accba
commit 5532262053
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -4,7 +4,7 @@ let
cfg = config.services.telegraf-magic; cfg = config.services.telegraf-magic;
settingsFormat = pkgs.formats.toml {}; settingsFormat = pkgs.formats.toml {};
configFile = settingsFormat.generate "config.toml" cfg.extraConfig; configFile = settingsFormat.generate "config.toml" cfg.settings;
in { in {
options = { options = {
services.telegraf-magic = { services.telegraf-magic = {
@ -36,13 +36,14 @@ in {
systemd = mkOption { systemd = mkOption {
default = {}; default = {};
description = lib.mdDoc "Applied to `systemd.services.telegraf`."; description = lib.mdDoc "Applied to `systemd.services.telegraf`.";
type = type.unspecified; type = types.unspecified;
}; };
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.telegraf = mkMerge [ systemd.services.telegraf = mkMerge [
(cfg.systemd)
{ {
description = "Telegraf Agent"; description = "Telegraf Agent";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@ -58,7 +59,6 @@ in {
AmbientCapabilities = [ "CAP_NET_RAW" ]; AmbientCapabilities = [ "CAP_NET_RAW" ];
}; };
} }
(config.services.telegraf.systemd)
]; ];
users.users.telegraf = { users.users.telegraf = {