Arion: Add homeassistant grafana integration

This commit is contained in:
GHOSCHT 2025-03-10 21:27:17 +01:00
parent 9a9a1f947d
commit 3a0c029419
Signed by: ghoscht
GPG key ID: 2C2C1C62A5388E82
2 changed files with 49 additions and 2 deletions
hosts/franz/arion/smarthome

View file

@ -79,5 +79,20 @@
"dmz"
];
};
influxdb.service = {
image = "influxdb:2.7.11";
volumes = [
"/home/ghoscht/.docker/smarthome/influxdb_data:/var/lib/influxdb2"
"/home/ghoscht/.docker/smarthome/influxdb_config:/etc/influxdb2"
];
environment = {
DOCKER_INFLUXDB_INIT_MODE = "setup";
};
env_file=["/home/ghoscht/.docker/smarthome/influxdb.env"];
restart = "always";
networks = [
"dmz"
];
};
};
}

View file

@ -1,7 +1,39 @@
{config, ...}: {
{ config, ... }:
let
vars = import ../../../../vars.nix;
in
{
virtualisation.arion = {
projects.smarthome.settings = {
imports = [./arion-compose.nix];
imports = [ ./arion-compose.nix ];
};
};
sops.secrets = {
"homeassistant/influxdb_username" = {
owner = vars.user;
};
"homeassistant/influxdb_password" = {
owner = vars.user;
};
"homeassistant/influxdb_org" = {
owner = vars.user;
};
"homeassistant/influxdb_bucket" = {
owner = vars.user;
};
};
sops.templates = {
"influxdb.env" = {
path = "/home/${vars.user}/.docker/smarthome/influxdb.env";
owner = vars.user;
mode = "0775";
content = ''
DOCKER_INFLUXDB_INIT_USERNAME="${config.sops.placeholder."homeassistant/influxdb_username"}"
DOCKER_INFLUXDB_INIT_PASSWORD="${config.sops.placeholder."homeassistant/influxdb_password"}"
DOCKER_INFLUXDB_INIT_ORG="${config.sops.placeholder."homeassistant/influxdb_org"}"
DOCKER_INFLUXDB_INIT_BUCKET="${config.sops.placeholder."homeassistant/influxdb_bucket"}"
'';
};
};
}