got grafana working
This commit is contained in:
parent
c51987536a
commit
0aba3aac80
6 changed files with 84 additions and 16 deletions
|
@ -23,25 +23,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts."${name}_directories" = ''
|
system.activationScripts."${name}_directories" = ''
|
||||||
mkdir -p ${hostDataDir}
|
mkdir -p ${hostDataDir}
|
||||||
chown -R root:root ${hostDataDir}
|
chown -R root:root ${hostDataDir}
|
||||||
chmod -R 777 ${hostDataDir}
|
chmod -R 777 ${hostDataDir}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
|
||||||
"100.64.0.13" = {
|
|
||||||
locations."/" = {
|
|
||||||
return = "301 http://h001.net.joshuabell.xyz";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"h001.net.joshuabell.xyz" = {
|
|
||||||
locations = {
|
|
||||||
"/" = {
|
|
||||||
proxyWebsockets = true;
|
|
||||||
proxyPass = "http://127.0.0.1:${builtins.toString v_port}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./mods
|
./mods
|
||||||
|
./nginx.nix
|
||||||
(import ./containers { inherit inputs; })
|
(import ./containers { inherit inputs; })
|
||||||
(
|
(
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
|
@ -5,5 +5,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./adguardhome.nix
|
./adguardhome.nix
|
||||||
./nixarr.nix
|
./nixarr.nix
|
||||||
|
./monitoring.nix
|
||||||
|
./reporting.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
32
hosts/h001/mods/monitoring.nix
Normal file
32
hosts/h001/mods/monitoring.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "localhost:9100" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
http_port = 3001;
|
||||||
|
serve_from_sub_path = true;
|
||||||
|
domain = "h001.net.joshuabell.xyz";
|
||||||
|
root_url = "http://h001.net.joshuabell.xyz/grafana/";
|
||||||
|
enforce_domain = true;
|
||||||
|
enable_gzip = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
8
hosts/h001/mods/reporting.nix
Normal file
8
hosts/h001/mods/reporting.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
services.prometheus.exporters.node.enable = true;
|
||||||
|
};
|
||||||
|
}
|
40
hosts/h001/nginx.nix
Normal file
40
hosts/h001/nginx.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
homarr = {
|
||||||
|
proxyWebsockets = true;
|
||||||
|
proxyPass = "http://localhost:7575";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
"10.12.14.2" = {
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
return = "301 http://h001.local.joshuabell.xyz";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"h001.local.joshuabell.xyz" = {
|
||||||
|
locations = {
|
||||||
|
"/" = homarr;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"100.64.0.13" = {
|
||||||
|
locations."/" = {
|
||||||
|
return = "301 http://h001.net.joshuabell.xyz";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"h001.net.joshuabell.xyz" = {
|
||||||
|
locations = {
|
||||||
|
"/grafana/" = {
|
||||||
|
proxyPass = "http://localhost:3001";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
};
|
||||||
|
"/" = homarr;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue