grimm-nixos-laptop/modules/grafana.nix

30 lines
692 B
Nix
Raw Normal View History

2024-05-08 21:49:37 +02:00
{ config, ... }:
let
inherit (config.serverConfig) ports vhosts;
2024-05-08 21:49:37 +02:00
inherit (config.networking) domain;
2024-05-08 21:50:08 +02:00
in
{
2024-05-08 21:49:37 +02:00
age.secrets.grafana_admin_pass = {
file = ../secrets/grafana_admin_pass.age;
owner = "grafana";
group = "grafana";
mode = "0600";
};
services.grafana = {
enable = true;
settings = {
security = {
admin_user = "admin";
admin_email = "admin@${domain}";
admin_password = "$__file{${config.age.secrets.grafana_admin_pass.path}}";
};
server = {
domain = vhosts.grafana_host.host;
root_url = "https://${vhosts.grafana_host.host}";
http_port = vhosts.grafana_host.port;
2024-05-08 21:49:37 +02:00
};
};
};
}