mirror of
https://git.gay/xqtc/nixos-config
synced 2024-11-22 15:50:32 +01:00
Some fixups and further config
This commit is contained in:
parent
10d7e7a560
commit
88498233d3
|
@ -12,6 +12,8 @@
|
|||
../../../common
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
../../gc.nix
|
||||
|
||||
./monitoring.nix
|
||||
];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
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 = {
|
||||
enable = true;
|
||||
# domain = "grafana";
|
||||
settings.server = {
|
||||
# domain = "grafana.seraphim.fritz.box";
|
||||
port = 2342;
|
||||
addr = "127.0.0.1";
|
||||
};
|
||||
};
|
||||
|
||||
# nginx reverse proxy
|
||||
services.nginx.virtualHosts.${config.services.grafana.domain} = {
|
||||
services.prometheus = {
|
||||
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."/" = {
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
'';
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue