blob: 6aee70fa99297f408326e41aa73c6e0d5d62193d [file] [log] [blame]
Skyler Greya78aa672023-05-20 13:48:18 +02001{ lib, config, ... }: {
Skyler Grey6f0f43d2023-05-03 15:01:05 +00002 services.grafana = {
3 enable = true;
4
5 settings = {
6 server = rec {
7 domain = "logs.clicks.codes";
Skyler Greya78aa672023-05-20 13:48:18 +02008 root_url = "https://${domain}";
Skyler Grey6f0f43d2023-05-03 15:01:05 +00009 http_port = 9052;
10 enable_gzip = true;
11 };
12 analytics.reporting_enabled = false;
13 };
Skyler Greya78aa672023-05-20 13:48:18 +020014
15 provision.datasources.settings.datasources = [{
16 name = "clicks-postgresql";
17 type = "postgres";
18 access = "proxy";
19
20 url = "postgres://localhost:${toString config.services.postgresql.port}";
21 user = "clicks_grafana";
22 password = "$__file{${config.sops.secrets.clicks_grafana_db_password.path}}";
23 # defined in postgres.nix
24 }];
Skyler Grey6f0f43d2023-05-03 15:01:05 +000025 };
26}