Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ADD grafana, loki, prometheus

+40 -1
+2
networking.nix
··· 60 60 5201 61 61 # NATS 62 62 4222 63 + # Prometheus 64 + 9001 63 65 ]; 64 66 }; 65 67
+38 -1
services.nix
··· 1 - { lib, ... }: 1 + { config, lib, ... }: 2 2 let 3 3 unstable = import <nixos-unstable> { 4 4 config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ ··· 170 170 }; 171 171 }; 172 172 173 + services.grafana = { 174 + enable = true; 175 + addr = "127.0.0.1"; 176 + settings.server.http_port = 2342; 177 + settings.server.domain = "grafana.packetlostandfound.us"; 178 + }; 179 + 180 + services.prometheus = { 181 + enable = true; 182 + port = 9001; 183 + exporters = { 184 + node = { 185 + enable = true; 186 + enabledCollectors = [ "systemd" ]; 187 + port = 9002; 188 + }; 189 + }; 190 + 191 + scrapeConfigs = [ 192 + { 193 + job_name = "chrysalis"; 194 + static_configs = [ 195 + { targets = [ "127.0.0.1:${builtins.toString config.services.prometheus.exporters.node.port}" ]; } 196 + ]; 197 + } 198 + ]; 199 + }; 200 + 173 201 # TODO: figure out how to appropriately configure this 174 202 services.step-ca = { 175 203 enable = false; ··· 207 235 services.nginx = { 208 236 enable = true; 209 237 group = "httpd"; 238 + 239 + virtualHosts."${config.services.grafana.settings.server.domain}" = { 240 + locations."/" = { 241 + proxyPass = "http://127.0.0.1:${builtins.toString config.services.grafana.settings.server.http_port}"; 242 + proxyWebsockets = true; 243 + }; 244 + }; 245 + 246 + 210 247 # give a name to the virtual host. It also becomes the server name. 211 248 virtualHosts."plex.packetlostandfound.us" = { 212 249 # Since we want a secure connection, we force SSL