From 6a51075486af02770495e819e9e7f7640eb25a9e Mon Sep 17 00:00:00 2001 From: notohh Date: Wed, 17 Jan 2024 08:53:19 -0500 Subject: [PATCH] modules: remove prometheus folder + other changes --- modules/default.nix | 3 +-- modules/nix.nix | 4 +++- .../{prometheus/default.nix => prometheus.nix} | 18 ++++++++---------- modules/prometheus/exporters/postgres.nix | 7 ------- modules/prometheus/exporters/redis.nix | 7 ------- modules/system.nix | 1 + 6 files changed, 13 insertions(+), 27 deletions(-) rename modules/{prometheus/default.nix => prometheus.nix} (82%) delete mode 100644 modules/prometheus/exporters/postgres.nix delete mode 100644 modules/prometheus/exporters/redis.nix diff --git a/modules/default.nix b/modules/default.nix index bacce58..6ba508e 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +1,7 @@ {inputs, ...}: { imports = [ inputs.nh.nixosModules.default - ./prometheus + ./prometheus.nix ./security.nix ./users.nix ./nix.nix @@ -11,5 +11,4 @@ ./sops.nix ./time.nix ]; - services.tailscale.enable = true; } diff --git a/modules/nix.nix b/modules/nix.nix index abbf262..1827c74 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -8,7 +8,9 @@ overlays = [inputs.nur.overlay]; config = { allowUnfree = true; - permittedInsecurePackages = lib.optional (pkgs.obsidian.version == "1.5.3") "electron-25.9.0"; + permittedInsecurePackages = [ + "electron-25.9.0" + ]; }; }; diff --git a/modules/prometheus/default.nix b/modules/prometheus.nix similarity index 82% rename from modules/prometheus/default.nix rename to modules/prometheus.nix index 54b9661..ae51649 100644 --- a/modules/prometheus/default.nix +++ b/modules/prometheus.nix @@ -2,37 +2,35 @@ _: { networking.firewall.allowedTCPPorts = [9090]; services.prometheus = { enable = true; + globalConfig = { + scrape_interval = "15s"; + evaluation_interval = "15s"; + }; scrapeConfigs = [ { job_name = "prometheus"; - scrape_interval = "15s"; static_configs = [{targets = ["localhost:9090"];}]; } { job_name = "node"; - scrape_interval = "15s"; static_configs = [{targets = ["localhost:9100"];}]; } { job_name = "traefik"; - scrape_interval = "15s"; static_configs = [{targets = ["100.104.42.96:8080"];}]; } - { - job_name = "redis_exporter"; - scrape_interval = "15s"; - static_configs = [{targets = ["100.94.214.100:9002"];}]; - } { job_name = "postgres"; - scrape_interval = "15s"; static_configs = [{targets = ["100.94.214.100:9003"];}]; } { job_name = "blocky"; - scrape_interval = "15s"; static_configs = [{targets = ["100.73.192.45:4000"];}]; } + { + job_name = "redis_exporter"; + static_configs = [{targets = ["100.94.214.100:9002"];}]; + } ]; exporters = { node = { diff --git a/modules/prometheus/exporters/postgres.nix b/modules/prometheus/exporters/postgres.nix deleted file mode 100644 index 33f7122..0000000 --- a/modules/prometheus/exporters/postgres.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - services.prometheus.exporters.postgres = { - enable = true; - openFirewall = true; - port = 9003; - }; -} diff --git a/modules/prometheus/exporters/redis.nix b/modules/prometheus/exporters/redis.nix deleted file mode 100644 index 4e03ff9..0000000 --- a/modules/prometheus/exporters/redis.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - services.prometheus.exporters.redis = { - enable = true; - openFirewall = true; - port = 9002; - }; -} diff --git a/modules/system.nix b/modules/system.nix index c62b3fe..9f26752 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -10,6 +10,7 @@ fstrim = { enable = true; }; + tailscale.enable = true; }; time.timeZone = "America/New_York";