about summary refs log tree commit diff
path: root/machines/x220/disko.nix
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-10-05 21:42:16 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-10-05 21:42:16 +0200
commit91432241065a8881bd1bc67c98d00618b85a05f5 (patch)
tree2d35e944306ea47f270cb74c7b7ed344b14cc6f6 /machines/x220/disko.nix
parent814fd0406dc2ead70c4aa075367ebdc3fd579589 (diff)
parent146b495e3e0069f2e329b3075a7367b0d954ead8 (diff)
downloaddots-91432241065a8881bd1bc67c98d00618b85a05f5.tar.gz
dots-91432241065a8881bd1bc67c98d00618b85a05f5.zip
Merge branch 'master' of github.com:pniedzwiedzinski/dots
Diffstat (limited to 'machines/x220/disko.nix')
-rw-r--r--machines/x220/disko.nix76
1 files changed, 76 insertions, 0 deletions
diff --git a/machines/x220/disko.nix b/machines/x220/disko.nix
new file mode 100644
index 0000000..714cafa
--- /dev/null
+++ b/machines/x220/disko.nix
@@ -0,0 +1,76 @@
+{
+  device ? throw "Set this to your disk device, e.g. /dev/sda",
+  ...
+}: {
+  disko.devices = {
+    disk.main = {
+      inherit device;
+      type = "disk";
+      content = {
+        type = "gpt";
+        partitions = {
+          boot = {
+            name = "boot";
+            size = "1M";
+            type = "EF02";
+          };
+          esp = {
+            name = "ESP";
+            size = "500M";
+            type = "EF00";
+            content = {
+              type = "filesystem";
+              format = "vfat";
+              mountpoint = "/boot";
+            };
+          };
+          swap = {
+            size = "13G";
+            content = {
+              type = "swap";
+              resumeDevice = true;
+            };
+          };
+          root = {
+            name = "root";
+            size = "100%";
+            content = {
+              type = "lvm_pv";
+              vg = "root_vg";
+            };
+          };
+        };
+      };
+    };
+    lvm_vg = {
+      root_vg = {
+        type = "lvm_vg";
+        lvs = {
+          root = {
+            size = "100%FREE";
+            content = {
+              type = "btrfs";
+              extraArgs = ["-f"];
+
+              subvolumes = {
+                "/root" = {
+                  mountpoint = "/";
+                };
+
+                "/persist" = {
+                  mountOptions = ["subvol=persist" "noatime"];
+                  mountpoint = "/persist";
+                };
+
+                "/nix" = {
+                  mountOptions = ["subvol=nix" "noatime"];
+                  mountpoint = "/nix";
+                };
+              };
+            };
+          };
+        };
+      };
+    };
+  };
+}