From 4e30363c5f3291b71a51a793cab28ca74fd5a0eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?=
 <nicolas.jeannerod@moduscreate.com>
Date: Tue, 25 Feb 2025 11:53:51 +0100
Subject: [PATCH] Generate list of machines from `machines` subdir

---
 infra/README.md      | 10 +++-------
 infra/flake-part.nix | 12 ++----------
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/infra/README.md b/infra/README.md
index b34cd10..3c113fb 100644
--- a/infra/README.md
+++ b/infra/README.md
@@ -13,13 +13,9 @@ everything will become much cleaner.
    above 100. For instance, `fedi117`.
 
 2. Add a basic configuration for the machine. These typically go in
-   `infra/<name>/default.nix`. You can look at other `fediXXX` VMs to find
-   inspiration. You probably do not need a `nixos.module` option at this point.
-
-3. Add the machine to a deployment. This takes place in `infra/flake-parts.nix`.
-   Please remember to also update the table at the end of this file.
-
-   FIXME: Generate the table automatically (https://git.fediversity.eu/Fediversity/Fediversity/issues/89)
+   `infra/machines/<name>/default.nix`. You can look at other `fediXXX` VMs to
+   find inspiration. You probably do not need a `nixos.module` option at this
+   point.
 
 2. Add a file for each of those VM's public keys, eg.
    ```
diff --git a/infra/flake-part.nix b/infra/flake-part.nix
index 784f094..64c4aa3 100644
--- a/infra/flake-part.nix
+++ b/infra/flake-part.nix
@@ -6,6 +6,7 @@
 }:
 
 let
+  inherit (builtins) readDir;
   inherit (lib)
     attrNames
     mkOption
@@ -115,16 +116,7 @@ let
       ;
   };
 
-  machines = [
-    "vm02116"
-    "vm02179"
-    "vm02186"
-    "vm02187"
-
-    "fedi200"
-    "fedi201"
-  ];
-
+  machines = attrNames (readDir ./machines);
   testMachineConfigurations = import ./test-machines/configuration.nix;
 
 in