fix: NixOS | fix disko lvm_luks setup

This commit is contained in:
Shahab Dogar
2025-02-07 00:05:50 +05:00
parent 781cd2811c
commit 3a32da519b

View File

@@ -1,86 +1,88 @@
{device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: { {
disko.devices = { disko = {
disk = { devices = {
main = { disk = {
inherit device; main = {
type = "disk"; device = "/dev/nvme0n1";
content = { type = "disk";
type = "gpt"; content = {
partitions = { type = "gpt";
boot = { partitions = {
name = "boot"; boot = {
size = "1M"; name = "boot";
type = "EF02"; size = "1M";
}; type = "EF02";
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
}; };
}; esp = {
luks = { name = "ESP";
size = "100%"; size = "500M";
content = { type = "EF00";
name = "crypted";
type = "luks";
settings = {
allowDiscards = true;
keyFile = "/tmp/secret.key";
crypttabExtraOpts = [
"fido2-device=auto"
"token-timeout=10"
];
};
content = { content = {
type = "lvm_pv"; type = "filesystem";
vg = "luks_vg"; format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
content = {
name = "crypted";
type = "luks";
passwordFile = "/tmp/secret.key";
settings = {
allowDiscards = true;
crypttabExtraOpts = [
"fido2-device=auto"
"token-timeout=10"
];
};
content = {
type = "lvm_pv";
vg = "luks_vg";
};
}; };
}; };
}; };
}; };
}; };
}; };
}; lvm_vg = {
}; luks_vg = {
lvm_vg = { type = "lvm_vg";
luks_vg = { lvs = {
type = "lvm_vg"; swap = {
lvs = { size = "64G";
swap = { content = {
size = "64G"; type = "swap";
content = { resumeDevice = true;
type = "swap";
resumeDevice = true;
};
};
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-L" "nixos" "-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
}; };
"/nix" = { };
mountpoint = "/nix"; root = {
mountOptions = [ size = "100%";
"subvol=nix" content = {
"compress=zstd" type = "btrfs";
"noatime" extraArgs = ["-L" "nixos" "-f"];
]; subvolumes = {
}; "/root" = {
"/persistant" = { mountpoint = "/";
mountpoint = "/persistant"; };
mountOptions = [ "/nix" = {
"subvol=persistant" mountpoint = "/nix";
"compress=zstd" mountOptions = [
"noatime" "subvol=nix"
]; "compress=zstd"
"noatime"
];
};
"/persistant" = {
mountpoint = "/persistant";
mountOptions = [
"subvol=persistant"
"compress=zstd"
"noatime"
];
};
};
}; };
}; };
}; };