2024-02-20 16:33:35 +01:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
secret = name: config.age.secrets."influxdb2-${name}".path;
|
|
|
|
token = user: secret "${user}_token_file";
|
|
|
|
|
|
|
|
host = "influx.dgnum.eu";
|
2024-10-12 18:40:03 +02:00
|
|
|
port = 8086;
|
2024-02-20 16:33:35 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
services.influxdb2 = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
provision = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
organizations = {
|
|
|
|
dgnum = {
|
|
|
|
description = "DGNum org";
|
|
|
|
buckets.telegraf.description = "Telegraf bucket";
|
2024-02-20 16:58:23 +01:00
|
|
|
auths = {
|
|
|
|
telegraf = {
|
|
|
|
writeBuckets = [ "telegraf" ];
|
|
|
|
tokenFile = token "telegraf";
|
|
|
|
};
|
|
|
|
|
|
|
|
grafana = {
|
|
|
|
readPermissions = [ "buckets" ];
|
|
|
|
tokenFile = token "grafana";
|
|
|
|
};
|
2024-02-20 16:33:35 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
initialSetup = {
|
|
|
|
tokenFile = token "initial";
|
|
|
|
passwordFile = secret "initial_password_file";
|
|
|
|
organization = "main";
|
|
|
|
bucket = "main";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-12 18:40:03 +02:00
|
|
|
dgn-web.simpleProxies.influxdb = {
|
|
|
|
inherit host port;
|
2024-02-20 16:33:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
age-secrets.autoMatch = [ "influxdb2" ];
|
|
|
|
}
|