summary refs log tree commit diff
path: root/hosts/vm/disko.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vm/disko.nix')
-rw-r--r--hosts/vm/disko.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/hosts/vm/disko.nix b/hosts/vm/disko.nix
new file mode 100644
index 0000000..6affd39
--- /dev/null
+++ b/hosts/vm/disko.nix
@@ -0,0 +1,52 @@
+{inputs, ...}: let
+  device = "/dev/vda";
+in {
+  imports = [
+    inputs.disko.nixosModules.disko
+  ];
+
+  disko.devices = {
+    disk.${baseNameOf device} = {
+      inherit device;
+      type = "disk";
+      content = {
+        type = "table";
+        format = "gpt";
+        partitions = [
+          {
+            type = "partition";
+            name = "ESP";
+            start = "1MiB";
+            end = "512MiB";
+            bootable = true;
+            content = {
+              type = "filesystem";
+              format = "vfat";
+              mountpoint = "/boot";
+            };
+          }
+          {
+            name = "nix";
+            type = "partition";
+            start = "512M";
+            end = "100%";
+            part-type = "primary";
+            content = {
+              type = "filesystem";
+              format = "ext4";
+              mountpoint = "/nix";
+            };
+          }
+        ];
+      };
+    };
+    nodev."/" = {
+      fsType = "tmpfs";
+      mountOptions = [
+        "size=3G"
+        "defaults"
+        "mode=755"
+      ];
+    };
+  };
+}