summary refs log tree commit diff
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-12-19 21:19:09 +0100
committerMel <einebeere@gmail.com>2024-12-19 21:19:17 +0100
commit900f2345281cdaace7fe4a1258c99e83abb3aa2b (patch)
tree507b5435c1ddcbf1a80735a8ff823f3cc321671a
parentc989e45850a1446af77a0cfdbc72f1835215671c (diff)
downloadnetwork-900f2345281cdaace7fe4a1258c99e83abb3aa2b.tar.zst
network-900f2345281cdaace7fe4a1258c99e83abb3aa2b.zip
Add monitoring configuration to all machines
Signed-off-by: Mel <einebeere@gmail.com>
-rw-r--r--flake.nix9
-rw-r--r--machines/corsac/default.nix2
-rw-r--r--machines/lapin/default.nix2
-rw-r--r--machines/renard/default.nix9
-rw-r--r--modules/www.nix2
5 files changed, 18 insertions, 6 deletions
diff --git a/flake.nix b/flake.nix
index 4a8b76f..7b9727e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -43,10 +43,10 @@
         };
       };
 
-      mkIdentities = ms: current:
-        lib.genAttrs (lib.catAttrs "name" ms) (m: current.name == m);
+    in machines: map (m: mkMachine m) machines;
 
-    in machines: map (m: (mkMachine m) // (mkIdentities machines m)) machines;
+    mkMachineIdentities = ms: current:
+      lib.genAttrs (lib.catAttrs "name" ms) (m: current.name == m);
 
     machines = with systems; mkMachines [
       { name = "corsac"; system = x86; tailscale.ip = "100.64.100.100"; }
@@ -74,7 +74,8 @@
         inherit (machine) system;
 
         specialArgs = inputs // (packageSetsForSystem machine.system) // {
-          me = machine;
+          inherit machines;
+          me = machine // { is = mkMachineIdentities machines machine; };
           keys = import ./secrets/keys.nix;
           util = import ./util.nix { inherit lib; };
         };
diff --git a/machines/corsac/default.nix b/machines/corsac/default.nix
index a80993f..d38d06a 100644
--- a/machines/corsac/default.nix
+++ b/machines/corsac/default.nix
@@ -17,5 +17,7 @@
     ../../services/transmission.nix
   ];
 
+  foundation.monitoring.client.enable = true;
+
   system.stateVersion = "24.05";
 }
diff --git a/machines/lapin/default.nix b/machines/lapin/default.nix
index 2e21328..4cdb9c5 100644
--- a/machines/lapin/default.nix
+++ b/machines/lapin/default.nix
@@ -14,6 +14,8 @@
     ../../services/akkoma
   ];
 
+  foundation.monitoring.client.enable = true;
+
   age.secrets.cloudflare-dns = {
     file = ../../secrets/cloudflare-dns.age;
   };
diff --git a/machines/renard/default.nix b/machines/renard/default.nix
index bd0af06..7a23fa9 100644
--- a/machines/renard/default.nix
+++ b/machines/renard/default.nix
@@ -1,4 +1,4 @@
-{ me, pkgs, lib, ... }:
+{ me, machines, pkgs, lib, ... }:
 
 {
   imports = [
@@ -18,6 +18,13 @@
     ../../services/irc
   ];
 
+  foundation.monitoring.server = {
+    enable = true;
+    hosts = map (m: {
+      inherit (m) name; inherit (m.tailscale) ip;
+    }) machines;
+  };
+
   systemd.services."acme-${me.tailscale.domain}" =
   let
     oneWeekInSeconds = 7 * 24 * 60 * 60;
diff --git a/modules/www.nix b/modules/www.nix
index 6e84ec0..33b0053 100644
--- a/modules/www.nix
+++ b/modules/www.nix
@@ -2,7 +2,7 @@
 
 let 
   rnrdUrl =
-    if me.renard
+    if me.is.renard
       then "rnrd.eu"
       else "${me.name}.rnrd.eu";
 in