mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 11:36:16 +01:00
Fix telegraf module
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
dd2a8accba
commit
5532262053
|
@ -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 = {
|
||||||
|
|
Loading…
Reference in a new issue