clanService/grafana: add requred attr

This commit is contained in:
2026-03-02 18:08:41 +07:00
parent 9b7e9b5be6
commit 73232a4800
11 changed files with 81 additions and 2 deletions

View File

@@ -13,11 +13,28 @@
{
config,
lib,
pkgs,
...
}:
{
clan.core.vars.generators.grafana = {
files = {
secret_key = {
owner = "grafana";
group = "grafana";
secret = true;
};
};
script = ''
openssl rand -hex 32 > "$out"/secret_key
'';
runtimeInputs = [
pkgs.openssl
];
};
services.grafana = {
enable = lib.mkDefault true;
settings.security.secret_key = "$__file{${config.clan.core.vars.generators.grafana.files.secret_key.path}}";
};
clan.core.state.grafana.folders = [ config.services.grafana.dataDir ];