mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
Remove lvm under btrfs (#24)
Reviewed-on: https://codeberg.org/leana8959/.files/pulls/24 Co-authored-by: Léana 江 <leana.jiang+git@icloud.com> Co-committed-by: Léana 江 <leana.jiang+git@icloud.com>
This commit is contained in:
parent
9b02b9e1da
commit
caadc265e4
19 changed files with 104 additions and 136 deletions
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue