From dbb4ce67fc784f5040926030bde338a2e2457900 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sun, 15 Jun 2025 15:01:56 +0200 Subject: [PATCH] move machines to reflect a semantic structure (#367) later we may want to distinguish dev vs host as well, tho eventually we expect not to have hard-coded machines anyway. split off from #319. Reviewed-on: https://git.fediversity.eu/Fediversity/Fediversity/pulls/367 Co-authored-by: Kiara Grouwstra Co-committed-by: Kiara Grouwstra --- infra/README.md | 4 ++-- infra/flake-part.nix | 8 ++++---- machines/README.md | 4 ++++ {infra/machines => machines/dev}/fedi200/default.nix | 0 {infra/machines => machines/dev}/fedi201/default.nix | 0 {infra/machines => machines/dev}/fedi201/fedipanel.nix | 0 {infra/machines => machines/dev}/vm02116/default.nix | 0 {infra/machines => machines/dev}/vm02116/forgejo.nix | 0 {infra/machines => machines/dev}/vm02187/default.nix | 0 {infra/machines => machines/dev}/vm02187/wiki.nix | 0 {infra => machines}/machines.md | 0 {infra => machines}/machines.md.sh | 2 +- .../operator}/test01/default.nix | 0 .../operator}/test01/ssh_host_ed25519_key | 0 .../operator}/test01/ssh_host_ed25519_key.pub | 0 .../operator}/test02/default.nix | 0 .../operator}/test02/ssh_host_ed25519_key | 0 .../operator}/test02/ssh_host_ed25519_key.pub | 0 .../operator}/test03/default.nix | 0 .../operator}/test03/ssh_host_ed25519_key | 0 .../operator}/test03/ssh_host_ed25519_key.pub | 0 .../operator}/test04/default.nix | 0 .../operator}/test04/ssh_host_ed25519_key | 0 .../operator}/test04/ssh_host_ed25519_key.pub | 0 .../operator}/test05/default.nix | 0 .../operator}/test05/ssh_host_ed25519_key | 0 .../operator}/test05/ssh_host_ed25519_key.pub | 0 .../operator}/test06/default.nix | 0 .../operator}/test06/ssh_host_ed25519_key | 0 .../operator}/test06/ssh_host_ed25519_key.pub | 0 .../operator}/test11/default.nix | 0 .../operator}/test11/ssh_host_ed25519_key | 0 .../operator}/test11/ssh_host_ed25519_key.pub | 0 .../operator}/test12/default.nix | 0 .../operator}/test12/ssh_host_ed25519_key | 0 .../operator}/test12/ssh_host_ed25519_key.pub | 0 .../operator}/test13/default.nix | 0 .../operator}/test13/ssh_host_ed25519_key | 0 .../operator}/test13/ssh_host_ed25519_key.pub | 0 .../operator}/test14/default.nix | 0 .../operator}/test14/ssh_host_ed25519_key | 0 .../operator}/test14/ssh_host_ed25519_key.pub | 0 42 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 machines/README.md rename {infra/machines => machines/dev}/fedi200/default.nix (100%) rename {infra/machines => machines/dev}/fedi201/default.nix (100%) rename {infra/machines => machines/dev}/fedi201/fedipanel.nix (100%) rename {infra/machines => machines/dev}/vm02116/default.nix (100%) rename {infra/machines => machines/dev}/vm02116/forgejo.nix (100%) rename {infra/machines => machines/dev}/vm02187/default.nix (100%) rename {infra/machines => machines/dev}/vm02187/wiki.nix (100%) rename {infra => machines}/machines.md (100%) rename {infra => machines}/machines.md.sh (92%) rename {infra/test-machines => machines/operator}/test01/default.nix (100%) rename {infra/test-machines => machines/operator}/test01/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test01/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test02/default.nix (100%) rename {infra/test-machines => machines/operator}/test02/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test02/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test03/default.nix (100%) rename {infra/test-machines => machines/operator}/test03/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test03/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test04/default.nix (100%) rename {infra/test-machines => machines/operator}/test04/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test04/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test05/default.nix (100%) rename {infra/test-machines => machines/operator}/test05/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test05/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test06/default.nix (100%) rename {infra/test-machines => machines/operator}/test06/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test06/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test11/default.nix (100%) rename {infra/test-machines => machines/operator}/test11/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test11/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test12/default.nix (100%) rename {infra/test-machines => machines/operator}/test12/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test12/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test13/default.nix (100%) rename {infra/test-machines => machines/operator}/test13/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test13/ssh_host_ed25519_key.pub (100%) rename {infra/test-machines => machines/operator}/test14/default.nix (100%) rename {infra/test-machines => machines/operator}/test14/ssh_host_ed25519_key (100%) rename {infra/test-machines => machines/operator}/test14/ssh_host_ed25519_key.pub (100%) diff --git a/infra/README.md b/infra/README.md index 133f6a32..422680fd 100644 --- a/infra/README.md +++ b/infra/README.md @@ -14,7 +14,7 @@ everything will become much cleaner. above 100. For instance, `fedi117`. 2. Add a basic configuration for the machine. These typically go in - `infra/machines//default.nix`. You can look at other `fediXXX` VMs to + `machines/dev//default.nix`. You can look at other `fediXXX` VMs to find inspiration. You probably do not need a `nixos.module` option at this point. @@ -48,7 +48,7 @@ everything will become much cleaner. 7. Regenerate the list of machines: ``` - sh infra/machines.md.sh + sh machines/machines.md.sh ``` Commit it with the machine's configuration, public key, etc. diff --git a/infra/flake-part.nix b/infra/flake-part.nix index af0fe51d..b7bd46f4 100644 --- a/infra/flake-part.nix +++ b/infra/flake-part.nix @@ -28,7 +28,7 @@ let ++ ( if isTestVm then [ - ./test-machines/${vmName} + ../machines/operator/${vmName} { nixos.module.users.users.root.openssh.authorizedKeys.keys = [ # allow our panel vm access to the test machines @@ -38,7 +38,7 @@ let ] else [ - ./machines/${vmName} + ../machines/dev/${vmName} ] ); fediversityVm.name = vmName; @@ -147,8 +147,8 @@ let listSubdirectories = path: attrNames (filterAttrs (_: type: type == "directory") (readDir path)); - machines = listSubdirectories ./machines; - testMachines = listSubdirectories ./test-machines; + machines = listSubdirectories ../machines/dev; + testMachines = listSubdirectories ../machines/operator; in { diff --git a/machines/README.md b/machines/README.md new file mode 100644 index 00000000..d51df126 --- /dev/null +++ b/machines/README.md @@ -0,0 +1,4 @@ +# Machines + +This directory contains the definition of [the VMs](machines.md) that host our +infrastructure. diff --git a/infra/machines/fedi200/default.nix b/machines/dev/fedi200/default.nix similarity index 100% rename from infra/machines/fedi200/default.nix rename to machines/dev/fedi200/default.nix diff --git a/infra/machines/fedi201/default.nix b/machines/dev/fedi201/default.nix similarity index 100% rename from infra/machines/fedi201/default.nix rename to machines/dev/fedi201/default.nix diff --git a/infra/machines/fedi201/fedipanel.nix b/machines/dev/fedi201/fedipanel.nix similarity index 100% rename from infra/machines/fedi201/fedipanel.nix rename to machines/dev/fedi201/fedipanel.nix diff --git a/infra/machines/vm02116/default.nix b/machines/dev/vm02116/default.nix similarity index 100% rename from infra/machines/vm02116/default.nix rename to machines/dev/vm02116/default.nix diff --git a/infra/machines/vm02116/forgejo.nix b/machines/dev/vm02116/forgejo.nix similarity index 100% rename from infra/machines/vm02116/forgejo.nix rename to machines/dev/vm02116/forgejo.nix diff --git a/infra/machines/vm02187/default.nix b/machines/dev/vm02187/default.nix similarity index 100% rename from infra/machines/vm02187/default.nix rename to machines/dev/vm02187/default.nix diff --git a/infra/machines/vm02187/wiki.nix b/machines/dev/vm02187/wiki.nix similarity index 100% rename from infra/machines/vm02187/wiki.nix rename to machines/dev/vm02187/wiki.nix diff --git a/infra/machines.md b/machines/machines.md similarity index 100% rename from infra/machines.md rename to machines/machines.md diff --git a/infra/machines.md.sh b/machines/machines.md.sh similarity index 92% rename from infra/machines.md.sh rename to machines/machines.md.sh index ea1b0208..d523e127 100644 --- a/infra/machines.md.sh +++ b/machines/machines.md.sh @@ -20,7 +20,7 @@ vmOptions=$( cd .. nix eval \ --impure --raw --expr " - builtins.toJSON (builtins.getFlake (builtins.toString ./.)).vmOptions + builtins.toJSON (builtins.getFlake (builtins.toString ../.)).vmOptions " \ --log-format raw --quiet ) diff --git a/infra/test-machines/test01/default.nix b/machines/operator/test01/default.nix similarity index 100% rename from infra/test-machines/test01/default.nix rename to machines/operator/test01/default.nix diff --git a/infra/test-machines/test01/ssh_host_ed25519_key b/machines/operator/test01/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test01/ssh_host_ed25519_key rename to machines/operator/test01/ssh_host_ed25519_key diff --git a/infra/test-machines/test01/ssh_host_ed25519_key.pub b/machines/operator/test01/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test01/ssh_host_ed25519_key.pub rename to machines/operator/test01/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test02/default.nix b/machines/operator/test02/default.nix similarity index 100% rename from infra/test-machines/test02/default.nix rename to machines/operator/test02/default.nix diff --git a/infra/test-machines/test02/ssh_host_ed25519_key b/machines/operator/test02/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test02/ssh_host_ed25519_key rename to machines/operator/test02/ssh_host_ed25519_key diff --git a/infra/test-machines/test02/ssh_host_ed25519_key.pub b/machines/operator/test02/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test02/ssh_host_ed25519_key.pub rename to machines/operator/test02/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test03/default.nix b/machines/operator/test03/default.nix similarity index 100% rename from infra/test-machines/test03/default.nix rename to machines/operator/test03/default.nix diff --git a/infra/test-machines/test03/ssh_host_ed25519_key b/machines/operator/test03/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test03/ssh_host_ed25519_key rename to machines/operator/test03/ssh_host_ed25519_key diff --git a/infra/test-machines/test03/ssh_host_ed25519_key.pub b/machines/operator/test03/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test03/ssh_host_ed25519_key.pub rename to machines/operator/test03/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test04/default.nix b/machines/operator/test04/default.nix similarity index 100% rename from infra/test-machines/test04/default.nix rename to machines/operator/test04/default.nix diff --git a/infra/test-machines/test04/ssh_host_ed25519_key b/machines/operator/test04/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test04/ssh_host_ed25519_key rename to machines/operator/test04/ssh_host_ed25519_key diff --git a/infra/test-machines/test04/ssh_host_ed25519_key.pub b/machines/operator/test04/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test04/ssh_host_ed25519_key.pub rename to machines/operator/test04/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test05/default.nix b/machines/operator/test05/default.nix similarity index 100% rename from infra/test-machines/test05/default.nix rename to machines/operator/test05/default.nix diff --git a/infra/test-machines/test05/ssh_host_ed25519_key b/machines/operator/test05/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test05/ssh_host_ed25519_key rename to machines/operator/test05/ssh_host_ed25519_key diff --git a/infra/test-machines/test05/ssh_host_ed25519_key.pub b/machines/operator/test05/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test05/ssh_host_ed25519_key.pub rename to machines/operator/test05/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test06/default.nix b/machines/operator/test06/default.nix similarity index 100% rename from infra/test-machines/test06/default.nix rename to machines/operator/test06/default.nix diff --git a/infra/test-machines/test06/ssh_host_ed25519_key b/machines/operator/test06/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test06/ssh_host_ed25519_key rename to machines/operator/test06/ssh_host_ed25519_key diff --git a/infra/test-machines/test06/ssh_host_ed25519_key.pub b/machines/operator/test06/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test06/ssh_host_ed25519_key.pub rename to machines/operator/test06/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test11/default.nix b/machines/operator/test11/default.nix similarity index 100% rename from infra/test-machines/test11/default.nix rename to machines/operator/test11/default.nix diff --git a/infra/test-machines/test11/ssh_host_ed25519_key b/machines/operator/test11/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test11/ssh_host_ed25519_key rename to machines/operator/test11/ssh_host_ed25519_key diff --git a/infra/test-machines/test11/ssh_host_ed25519_key.pub b/machines/operator/test11/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test11/ssh_host_ed25519_key.pub rename to machines/operator/test11/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test12/default.nix b/machines/operator/test12/default.nix similarity index 100% rename from infra/test-machines/test12/default.nix rename to machines/operator/test12/default.nix diff --git a/infra/test-machines/test12/ssh_host_ed25519_key b/machines/operator/test12/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test12/ssh_host_ed25519_key rename to machines/operator/test12/ssh_host_ed25519_key diff --git a/infra/test-machines/test12/ssh_host_ed25519_key.pub b/machines/operator/test12/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test12/ssh_host_ed25519_key.pub rename to machines/operator/test12/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test13/default.nix b/machines/operator/test13/default.nix similarity index 100% rename from infra/test-machines/test13/default.nix rename to machines/operator/test13/default.nix diff --git a/infra/test-machines/test13/ssh_host_ed25519_key b/machines/operator/test13/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test13/ssh_host_ed25519_key rename to machines/operator/test13/ssh_host_ed25519_key diff --git a/infra/test-machines/test13/ssh_host_ed25519_key.pub b/machines/operator/test13/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test13/ssh_host_ed25519_key.pub rename to machines/operator/test13/ssh_host_ed25519_key.pub diff --git a/infra/test-machines/test14/default.nix b/machines/operator/test14/default.nix similarity index 100% rename from infra/test-machines/test14/default.nix rename to machines/operator/test14/default.nix diff --git a/infra/test-machines/test14/ssh_host_ed25519_key b/machines/operator/test14/ssh_host_ed25519_key similarity index 100% rename from infra/test-machines/test14/ssh_host_ed25519_key rename to machines/operator/test14/ssh_host_ed25519_key diff --git a/infra/test-machines/test14/ssh_host_ed25519_key.pub b/machines/operator/test14/ssh_host_ed25519_key.pub similarity index 100% rename from infra/test-machines/test14/ssh_host_ed25519_key.pub rename to machines/operator/test14/ssh_host_ed25519_key.pub