nix-configs/partitions/luks-btrfs-subvolumes.nix
2023-12-29 17:32:35 +00:00

59 lines
1.8 KiB
Nix

{
disko.devices = {
disk = {
vdb = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1024M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
# disable settings.keyFile if you want to use interactive password entry
#passwordFile = "/tmp/secret.key"; # Interactive
settings = {
allowDiscards = true;
#keyFile = "/tmp/secret.key";
};
#additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd:10" "noatime" "commit=120"];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd:10" "noatime" "commit=120"];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd:10" "noatime" "commit=120"];
};
};
};
};
};
};
};
};
};
};
}