♻️ refactor some monitoring configs

This commit is contained in:
James Walker 2024-02-17 22:12:24 -05:00
parent 15d95e6208
commit f7e0ac3cbb
Signed by: walkah
SSH Key Fingerprint: SHA256:f7Gn4jO4BFHZxWfKTTzEAfWz+cLW51IyGFl9MjDyZGI
5 changed files with 23 additions and 47 deletions

View File

@ -29,27 +29,9 @@
firewall.enable = false; firewall.enable = false;
}; };
# Enable the OpenSSH daemon.
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [ users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
]; ];
environment.systemPackages = with pkgs; [ libraspberrypi raspberrypi-eeprom ]; environment.systemPackages = with pkgs; [ libraspberrypi raspberrypi-eeprom ];
services = {
prometheus = {
enable = true;
port = 9090;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
openFirewall = true;
port = 9100;
};
};
};
tailscale = { enable = true; };
};
} }

View File

@ -117,7 +117,6 @@ in
}; };
services = { services = {
openssh.enable = true;
borgbackup.jobs."borgbase" = { borgbackup.jobs."borgbase" = {
paths = [ paths = [
"/var/backup" "/var/backup"
@ -151,16 +150,6 @@ in
}; };
}; };
prometheus = { prometheus = {
enable = true;
port = 9090;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9100;
};
};
scrapeConfigs = [ scrapeConfigs = [
{ {
job_name = "node"; job_name = "node";
@ -189,7 +178,6 @@ in
]; ];
}; };
tailscale = { tailscale = {
enable = true;
useRoutingFeatures = "server"; useRoutingFeatures = "server";
}; };
}; };

View File

@ -62,21 +62,5 @@
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedProxySettings = true; recommendedProxySettings = true;
}; };
openssh = { enable = true; };
prometheus = {
enable = true;
port = 9090;
listenAddress = "100.103.57.96";
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
openFirewall = true;
port = 9100;
listenAddress = "100.103.57.96";
};
};
};
tailscale = { enable = true; };
}; };
} }

View File

@ -1,6 +1,6 @@
{ config, ... }: { { config, ... }: {
imports = [ ./common.nix ]; imports = [ ./common.nix ../monitoring ];
nix = { nix = {
gc = { gc = {
@ -20,6 +20,11 @@
mosh.enable = true; mosh.enable = true;
}; };
services = {
openssh.enable = true;
tailscale.enable = true;
};
system = { system = {
autoUpgrade = { autoUpgrade = {
enable = true; enable = true;

View File

@ -0,0 +1,17 @@
_:
{
services = {
prometheus = {
enable = true;
port = 9090;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9100;
};
};
};
};
}