From 5939aa8996d76b45c0bbe432504cea6bef10f22d Mon Sep 17 00:00:00 2001 From: Lzebulon Date: Mon, 3 Nov 2025 23:25:59 +0100 Subject: [PATCH] format && add node monitoring --- hosts/physique/hyponix/services/default.nix | 2 +- hosts/physique/hyponix/services/forgejo-runner.nix | 8 ++++---- hosts/physique/hyponix/services/forgejo.nix | 2 +- hosts/physique/hyponix/services/searxng.nix | 6 +++--- modules/common/default.nix | 1 + modules/common/monitoring.nix | 9 +++++++++ modules/default.nix | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 modules/common/monitoring.nix diff --git a/hosts/physique/hyponix/services/default.nix b/hosts/physique/hyponix/services/default.nix index 4713476..15a8cde 100644 --- a/hosts/physique/hyponix/services/default.nix +++ b/hosts/physique/hyponix/services/default.nix @@ -11,5 +11,5 @@ enable = true; }; - networking.firewall.allowedTCPPorts = [80 443]; + networking.firewall.allowedTCPPorts = [ 80 443 ]; } diff --git a/hosts/physique/hyponix/services/forgejo-runner.nix b/hosts/physique/hyponix/services/forgejo-runner.nix index cd5e404..a931ef9 100644 --- a/hosts/physique/hyponix/services/forgejo-runner.nix +++ b/hosts/physique/hyponix/services/forgejo-runner.nix @@ -1,13 +1,13 @@ -{pkgs, config,...}: +{ pkgs, config, ... }: { age.secrets.forgejo-runner-token-1 = { file = ../../../../secrets/services/forgejo/forgejo-runner-token-1.age; owner = "gitea-runner"; }; - + virtualisation.docker.enable = true; - + services.gitea-actions-runner = { package = pkgs.forgejo-runner; instances.default = { @@ -15,7 +15,7 @@ name = "runner-1"; url = "https://git.${config.networking.domain}"; - tokenFile = config.age.secrets.forgejo-runner-token-1.path; + tokenFile = config.age.secrets.forgejo-runner-token-1.path; labels = [ "nixos-latest:docker://nixos/nix:latest" diff --git a/hosts/physique/hyponix/services/forgejo.nix b/hosts/physique/hyponix/services/forgejo.nix index df6975f..a372bc7 100644 --- a/hosts/physique/hyponix/services/forgejo.nix +++ b/hosts/physique/hyponix/services/forgejo.nix @@ -1,4 +1,4 @@ -{config, ...}: +{ config, ... }: let domain = "git.${config.networking.domain}"; in diff --git a/hosts/physique/hyponix/services/searxng.nix b/hosts/physique/hyponix/services/searxng.nix index d205a32..1f7232c 100644 --- a/hosts/physique/hyponix/services/searxng.nix +++ b/hosts/physique/hyponix/services/searxng.nix @@ -1,13 +1,13 @@ -{config, ...}: +{ config, ... }: { age.secrets = { searxng-secret-key = { file = ../../../../secrets/services/searxng.age; - owner = "searx"; + owner = "searx"; }; }; - + services.searx = { enable = true; diff --git a/modules/common/default.nix b/modules/common/default.nix index 9b88858..f2829cf 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { imports = [ + ./monitoring.nix ./users.nix ]; diff --git a/modules/common/monitoring.nix b/modules/common/monitoring.nix new file mode 100644 index 0000000..f4ea630 --- /dev/null +++ b/modules/common/monitoring.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + services.prometheus.exporters = { + node = { + enable = true; + enabledCollecors = [ "systemd" ]; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 4bbe311..8fedcf6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,4 @@ -{...}: +{ ... }: { imports = [ ./common