From 7fab12c21f2919bb879c8103ea3803b4cc00170e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 24 Nov 2025 08:19:55 +0800 Subject: [PATCH] vanadium/disko: remove lvm under btrfs --- nix/disko/vanadium/btrfs.nix | 94 ++++++++++++------------------------ 1 file changed, 32 insertions(+), 62 deletions(-) diff --git a/nix/disko/vanadium/btrfs.nix b/nix/disko/vanadium/btrfs.nix index 11ae7b66..439c16a8 100644 --- a/nix/disko/vanadium/btrfs.nix +++ b/nix/disko/vanadium/btrfs.nix @@ -8,7 +8,7 @@ type = "gpt"; partitions = { ESP = { - size = "500M"; + size = "512M"; type = "EF00"; content = { type = "filesystem"; @@ -27,67 +27,37 @@ extraOpenArgs = [ ]; settings.allowDiscards = true; content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - }; - }; - }; - - # Use LVM to create a partition for swap - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - # Set swap device as resume device - swap = { - size = "48G"; # > 32G for hibernation - content = { - type = "swap"; - discardPolicy = "both"; - resumeDevice = true; - }; - }; - - # Use btrfs over ext4 for: - # - compression - # nix store can be shrinked using this feature - # - more transparent partitions (subvolumes) - # no more "I need more space here and not there" - btrfs = { - size = "100%"; - content = { - type = "btrfs"; - - mountpoint = "/btrfs-root"; - - # # DANGER: - # # Override existing partition at partition creation - # extraArgs = ["-f"]; - - subvolumes = { - "/root" = { - mountOptions = [ "noatime" ]; - mountpoint = "/"; - }; - - "/home" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/home"; - }; - - "/nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; + type = "btrfs"; + # # DANGER: + # # Override existing partition at partition creation + # extraArgs = ["-f"]; + subvolumes = { + "/root" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/"; + }; + "/home" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/home"; + }; + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + "/swap" = { + mountpoint = "/.swapvol"; + swap.swapfile.size = "1G"; + }; + }; }; }; };