nixos-framework-laptop-config/nixos/disk-config.nix
2024-12-28 19:33:49 -05:00

69 lines
2.3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
# checkout the example folder for how to configure different disko layouts
disko.devices = {
disk.fw16-2280 = {
device = "/dev/disk/by-path/pci-0000:05:00.0-nvme-1";
content = {
type = "gpt";
partitions = {
esp = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["noatime" "fmask=0077" "dmask=0077"];
};
};
cryptall = {
size = "100%";
content = {
type = "luks";
name = "all";
settings = {
# allowDiscards = true;
# keyFile = "/tmp/secret.key";
};
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
# System state which should be persistent across reboots and possibly backed up.
"/@nixos-persist" = {
mountpoint = "/persist";
mountOptions = ["noatime" "compress=zstd"];
};
# Im not so interested in backing up logs but I want them to be preserved across reboots,
# so Im dedicating a subvolume to logs rather than using the persist subvolume.
"/@nixos-varlog" = {
mountpoint = "/var/log";
mountOptions = ["noatime" "compress=zstd"];
};
# Needs to be persistent but is not worth backing up, as its trivial to reconstruct.
"/@nixos-nix" = {
mountpoint = "/nix";
mountOptions = ["noatime" "compress=zstd"];
};
"/@data" = {
mountpoint = "/data";
mountOptions = ["noatime" "compress=zstd"];
};
"/@home-evar" = {
mountpoint = "/home/evar";
mountOptions = ["noatime" "compress=zstd"];
};
};
};
};
};
};
};
};
nodev."/" = {
fsType = "tmpfs";
mountOptions = ["size=25%" "mode=755"];
};
};
}