From c7ccbec7c0451322c53e201dadff8d71f242bd66 Mon Sep 17 00:00:00 2001 From: pazpi Date: Thu, 29 Aug 2024 09:19:46 +0200 Subject: [PATCH] New container for monitoring --- flake.nix | 25 +++++++++++++-------- hosts/default.nix | 13 +++++++++++ hosts/metrics/default.nix | 37 +++++++++++++++++++++++++++++++ modules/services/download-pod.nix | 2 +- 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 hosts/metrics/default.nix diff --git a/flake.nix b/flake.nix index a7503af..87176d6 100644 --- a/flake.nix +++ b/flake.nix @@ -74,15 +74,22 @@ deployment.targetUser = "pazpi"; }; - arr = { - deployment = { - targetHost = "192.168.1.189"; - targetUser = lib.mkForce "root"; - tags = [ - "lxc" - "bacco" - ]; - }; + arr.deployment = { + targetHost = "192.168.1.189"; + targetUser = lib.mkForce "root"; + tags = [ + "lxc" + "bacco" + ]; + }; + + metrics.deployment = { + targetHost = "192.168.1.152"; + targetUser = lib.mkForce "root"; + tags = [ + "lxc" + "bacco" + ]; }; deadbeef.deployment = { diff --git a/hosts/default.nix b/hosts/default.nix index 3d3f4d7..77f4b9c 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -57,4 +57,17 @@ in }; }; + metrics = nixpkgs.lib.nixosSystem { + pkgs = pkgs "x86_64-linux"; + modules = [ + myModule + proxmoxModule + ./metrics + agenix.nixosModules.default + ]; + specialArgs = { + # inherit nixvim nix-index-database; + }; + }; + } diff --git a/hosts/metrics/default.nix b/hosts/metrics/default.nix new file mode 100644 index 0000000..9788988 --- /dev/null +++ b/hosts/metrics/default.nix @@ -0,0 +1,37 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + my = { + utils.commons.enable = true; + + networking.tailscale = { + enable = false; + exitNode = "vps"; + # authKeyFile = builtins.toFile "authKey" ''${parameters.tailscaleAuthKey}''; + }; + + virtualisation = { + proxmox.enable = true; + }; + }; + + time.timeZone = "Europe/Rome"; + + # Extra packages + environment.systemPackages = with pkgs; [ ]; + + services = { + openssh.enable = true; + + prometheus = { + enable = true; + }; + + }; + + system.stateVersion = "24.05"; +} diff --git a/modules/services/download-pod.nix b/modules/services/download-pod.nix index 8b82a1f..33c8a87 100644 --- a/modules/services/download-pod.nix +++ b/modules/services/download-pod.nix @@ -76,7 +76,7 @@ let in { options.my.services.download-pod = { - enable = lib.mkEnableOption "Enable the download searcher stack"; + enable = lib.mkEnableOption "Enable the download search stack"; proxy = { enable = lib.mkEnableOption "Enable proxy for the services";