diff options
Diffstat (limited to 'hosts/vidhar/default.nix')
-rw-r--r-- | hosts/vidhar/default.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 29cd96db..ee67d254 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix | |||
@@ -119,5 +119,36 @@ | |||
119 | 119 | ||
120 | cpuFreqGovernor = "schedutil"; | 120 | cpuFreqGovernor = "schedutil"; |
121 | }; | 121 | }; |
122 | |||
123 | services.nginx = { | ||
124 | enable = true; | ||
125 | upstreams.grafana = { | ||
126 | servers = { "unix:${config.services.grafana.socket}" = {}; }; | ||
127 | }; | ||
128 | virtualHosts = { | ||
129 | ${config.services.grafana.domain} = { | ||
130 | locations."/" = { | ||
131 | proxyPass = "http://grafana"; | ||
132 | proxyWebsockets = true; | ||
133 | }; | ||
134 | }; | ||
135 | }; | ||
136 | }; | ||
137 | services.grafana = { | ||
138 | enable = true; | ||
139 | analytics.reporting.enable = false; | ||
140 | domain = "grafana.vidhar.yggdrasil"; | ||
141 | security.adminPasswordFile = config.sops.secrets."grafana-admin-password".path; | ||
142 | security.secretKeyFile = config.sops.secrets."grafana-secret-key".path; | ||
143 | protocol = "socket"; | ||
144 | }; | ||
145 | sops.secrets."grafana-admin-password" = { | ||
146 | format = "binary"; | ||
147 | sopsFile = ./grafana-admin-password; | ||
148 | }; | ||
149 | sops.secrets."grafana-secret-key" = { | ||
150 | format = "binary"; | ||
151 | sopsFile = ./grafana-secret-key; | ||
152 | }; | ||
122 | }; | 153 | }; |
123 | } | 154 | } |