From 0813eca20c58e28cd39494c3966b745b6507b839 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: Mon, 24 Feb 2025 12:39:49 +0100
Subject: [PATCH] Add options for Proxmox and Proxmox VM id

---
 infra/common/options.nix  | 24 ++++++++++++++++++++++++
 infra/fedi200/default.nix |  2 ++
 2 files changed, 26 insertions(+)

diff --git a/infra/common/options.nix b/infra/common/options.nix
index 39c2e1d2..4ea5e62e 100644
--- a/infra/common/options.nix
+++ b/infra/common/options.nix
@@ -2,6 +2,7 @@
 
 let
   inherit (lib) mkOption;
+  inherit (lib.types) types;
 
 in
 {
@@ -13,6 +14,29 @@ in
       '';
     };
 
+    proxmox = mkOption {
+      type = types.nullOr (
+        types.enum [
+          "procolix"
+          "fediversity"
+        ]
+      );
+      description = ''
+        The Proxmox instance. This is used for provisioning only and should be
+        set to `null` if the machine is not a VM.
+      '';
+    };
+
+    vmId = mkOption {
+      # REVIEW: There is `types.ints.between` but maybe not `types.ints.above`?
+      type = types.nullOr (types.addCheck types.int (x: x >= 100));
+      description = ''
+        The id of the machine in the corresponding Proxmox. This is used for
+        provisioning only and should be set to `null` if the machine is not a
+        VM.
+      '';
+    };
+
     domain = mkOption {
       description = ''
         The domain hosting the machine. Most of the time, this will be either of
diff --git a/infra/fedi200/default.nix b/infra/fedi200/default.nix
index b8db0479..db9950ea 100644
--- a/infra/fedi200/default.nix
+++ b/infra/fedi200/default.nix
@@ -1,5 +1,7 @@
 {
   fediversityVm = {
+    vmId = 200;
+    proxmox = "fediversity";
     domain = "abundos.eu";
     ipv4 = {
       address = "95.215.187.200";