-
Notifications
You must be signed in to change notification settings - Fork 1
/
grafana.nix
45 lines (41 loc) · 1.04 KB
/
grafana.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ config, pkgs, lib, ... }:
let
url = "grafana.oliver-koss.at";
in
{
services.grafana = {
enable = true;
addr = "0.0.0.0";
domain = url;
rootUrl = "https://" + url;
protocol = "socket";
security = {
adminUser = "admin";
};
settings = {
/* "auth.anonymous" = {
enabled = true;
org_name = "Funkfeuer Graz";
org_role = "Viewer";
hide_version = true;
}; */
};
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
upstreams.grafana.servers."unix:/${config.services.grafana.socket}" = {};
virtualHosts.${url} = {
root = config.services.grafana.staticRootPath;
enableACME = true;
forceSSL = true;
locations."/".tryFiles = "$uri @grafana";
locations."@grafana".proxyPass = "http://grafana";
};
};
users.users.nginx.extraGroups = [ "grafana" ];
networking.firewall.allowedTCPPorts = [ 80 443 ];
}