mirror of
https://git.gay/xqtc/nixos-config
synced 2024-11-22 21:20: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,15 +1,46 @@
|
||||||
{ config, pkgs, ... }: {
|
{
|
||||||
# grafana configuration
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
networking.firewall.allowedTCPPorts = [80 443 9001];
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# domain = "grafana";
|
settings.server = {
|
||||||
|
# domain = "grafana.seraphim.fritz.box";
|
||||||
port = 2342;
|
port = 2342;
|
||||||
addr = "127.0.0.1";
|
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."/" = {
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
'';
|
||||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue