mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-14 04:52:56 +00:00
31 lines
634 B
Nix
31 lines
634 B
Nix
{ config, pkgs, lib, ... }: {
|
|
|
|
options.metricsServer = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "Hostname of the Grafana server.";
|
|
};
|
|
|
|
config = {
|
|
|
|
services.grafana.enable = true;
|
|
services.prometheus = {
|
|
enable = true;
|
|
exporters.node.enable = true;
|
|
scrapeConfigs = [{
|
|
job_name = "local";
|
|
static_configs = [{ targets = [ "127.0.0.1:9100" ]; }];
|
|
}];
|
|
};
|
|
|
|
caddyRoutes = [{
|
|
match = [{ host = [ config.metricsServer ]; }];
|
|
handle = [{
|
|
handler = "reverse_proxy";
|
|
upstreams = [{ dial = "localhost:3000"; }];
|
|
}];
|
|
}];
|
|
|
|
};
|
|
|
|
}
|