58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{ lib, config, pkgs, inputs, ... }: {
|
|
|
|
imports = [
|
|
./logging/prometheus.nix
|
|
./logging/suricata.nix
|
|
../hardware/logging.nix
|
|
./headless.nix
|
|
(import ./networking.nix {
|
|
hostname = "r330-logging";
|
|
ip_address = "192.168.100.41";
|
|
open_ports = [ 3000 9001 9003 ];
|
|
inherit lib;
|
|
})
|
|
|
|
];
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
users.users.logging = import ./user.nix;
|
|
|
|
services.grafana = {
|
|
enable = true;
|
|
settings.server = {
|
|
http_addr = "127.0.0.1";
|
|
http_port = 3000;
|
|
domain = "grafana.randomctf.local";
|
|
};
|
|
};
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
virtualHosts = {
|
|
# Grafana
|
|
"grafana.randomctf.local" = {
|
|
extraConfig = ''
|
|
access_log /var/log/nginx/access.grafana.log;
|
|
'';
|
|
|
|
locations."/".extraConfig = ''
|
|
proxy_set_header Host grafana.randomctf.local;
|
|
proxy_pass http://localhost:3000/;
|
|
'';
|
|
};
|
|
|
|
# Prometheus
|
|
"prometheus.randomctf.local" = {
|
|
extraConfig = ''
|
|
access_log /var/log/nginx/access.prometheus.log;
|
|
'';
|
|
|
|
locations."/".extraConfig = ''
|
|
proxy_pass http://localhost:9090/;
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|