From 743a0f6daa7a62c88cbf07c354259d9583d85235 Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:30:57 +0100 Subject: [PATCH] Add franz disko partitioning --- hosts/franz/disko.nix | 73 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 hosts/franz/disko.nix diff --git a/hosts/franz/disko.nix b/hosts/franz/disko.nix new file mode 100644 index 0000000..c49a50a --- /dev/null +++ b/hosts/franz/disko.nix @@ -0,0 +1,73 @@ +{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 = "4G"; + 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 = "/"; + }; + + "/home" = { + mountOptions = ["compress=zstd"]; + mountpoint = "/home"; + }; + + "/nix" = { + mountOptions = ["subvol=nix" "compress=zstd" "noatime"]; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + }; + }; +}