vanadium/disko: remove lvm under btrfs

This commit is contained in:
Primrose 2025-11-24 08:19:55 +08:00
parent 9b02b9e1da
commit 7fab12c21f
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -8,7 +8,7 @@
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
size = "500M"; size = "512M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
@ -26,54 +26,19 @@
name = "crypted"; name = "crypted";
extraOpenArgs = [ ]; extraOpenArgs = [ ];
settings.allowDiscards = true; 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 = { content = {
type = "btrfs"; type = "btrfs";
mountpoint = "/btrfs-root";
# # DANGER: # # DANGER:
# # Override existing partition at partition creation # # Override existing partition at partition creation
# extraArgs = ["-f"]; # extraArgs = ["-f"];
subvolumes = { subvolumes = {
"/root" = { "/root" = {
mountOptions = [ "noatime" ]; mountOptions = [
"compress=zstd"
"noatime"
];
mountpoint = "/"; mountpoint = "/";
}; };
"/home" = { "/home" = {
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"
@ -81,7 +46,6 @@
]; ];
mountpoint = "/home"; mountpoint = "/home";
}; };
"/nix" = { "/nix" = {
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"
@ -89,6 +53,12 @@
]; ];
mountpoint = "/nix"; mountpoint = "/nix";
}; };
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "1G";
};
};
};
}; };
}; };
}; };