mirror of
https://git.gay/xqtc/nixos-config
synced 2024-11-22 21:00:32 +01:00
Some fixups and further config
This commit is contained in:
parent
10d7e7a560
commit
88498233d3
|
@ -12,6 +12,8 @@
|
||||||
../../../common
|
../../../common
|
||||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||||
../../gc.nix
|
../../gc.nix
|
||||||
|
|
||||||
|
./monitoring.nix
|
||||||
];
|
];
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||||
|
|
|
@ -1,17 +1,48 @@
|
||||||
{ config, pkgs, ... }: {
|
{
|
||||||
# grafana configuration
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
networking.firewall.allowedTCPPorts = [80 443 9001];
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# domain = "grafana";
|
settings.server = {
|
||||||
port = 2342;
|
# domain = "grafana.seraphim.fritz.box";
|
||||||
addr = "127.0.0.1";
|
port = 2342;
|
||||||
|
addr = "127.0.0.1";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# nginx reverse proxy
|
services.prometheus = {
|
||||||
services.nginx.virtualHosts.${config.services.grafana.domain} = {
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = ["systemd"];
|
||||||
|
port = 9002;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "seraphim";
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.enable = true;
|
||||||
|
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
extraConfig = ''
|
||||||
proxyWebsockets = true;
|
proxy_set_header Host $host;
|
||||||
|
'';
|
||||||
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue