converted to flakes and implemented sops-nix for the telegraf token
This commit is contained in:
14
telegraf.nix
14
telegraf.nix
@@ -1,18 +1,22 @@
|
||||
{ ... }:
|
||||
{ config, ... }:
|
||||
let
|
||||
influxURL = "http://panoptes.john-stream.com:8086";
|
||||
organization = "homelab";
|
||||
bucket = "docker";
|
||||
envFile = ./telegraf.env;
|
||||
token = "${builtins.readFile config.sops.secrets."telegraf_influx_token".path}";
|
||||
in
|
||||
{
|
||||
systemd.services.telegraf.serviceConfig = {
|
||||
SupplementaryGroups = [ "docker" ];
|
||||
sops.secrets."telegraf_influx_token" = { };
|
||||
|
||||
systemd.services.telegraf = {
|
||||
environment = {
|
||||
INFLUX_WRITE_TOKEN = token;
|
||||
};
|
||||
serviceConfig.SupplementaryGroups = [ "docker" ];
|
||||
};
|
||||
|
||||
services.telegraf = {
|
||||
enable = true;
|
||||
environmentFiles = [ "${envFile}" ];
|
||||
extraConfig = {
|
||||
agent = {
|
||||
interval = "10s";
|
||||
|
||||
Reference in New Issue
Block a user