mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
102 lines
2.4 KiB
Nix
102 lines
2.4 KiB
Nix
{
|
|
disko.devices = {
|
|
disk = {
|
|
main = {
|
|
type = "disk";
|
|
device = "/dev/nvme0n1";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ESP = {
|
|
size = "500M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = ["umask=0077"];
|
|
};
|
|
};
|
|
|
|
# Use LUKS for disk encryption
|
|
luks = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypted";
|
|
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" = {
|
|
mountpoint = "/";
|
|
};
|
|
|
|
"/home" = {
|
|
mountOptions = ["compress=zstd"];
|
|
mountpoint = "/home";
|
|
};
|
|
|
|
"/nix" = {
|
|
mountOptions = ["compress=zstd" "noatime"];
|
|
mountpoint = "/nix";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# It's nice to have a scratch space
|
|
nodev = {
|
|
"/tmp" = {
|
|
fsType = "tmpfs";
|
|
mountOptions = [
|
|
"size=4G"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|