disk settings

This commit is contained in:
2026-03-08 15:51:42 +01:00
parent c6ce651170
commit bcace1acbb
6 changed files with 47 additions and 28 deletions

View File

@@ -0,0 +1,53 @@
{ ... }: {
flake.nixosModules.disks-sys-singledisk-encrypted = { inputs, lib, ... }: {
imports = [ inputs.disko.nixosModules.disko ];
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1024M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "fmask=0077" "dmask=0077" ];
extraArgs = [ "-n" "boot" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "cryptroot";
settings.allowDiscards = true;
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/";
extraArgs = [ "-L" "root" ];
};
};
};
};
};
};
};
};
swapDevices = [{
device = "/var/lib/swapfile";
size = 16 * 1024;
}];
boot.initrd.luks.devices."cryptroot" = {
device = lib.mkForce "/dev/nvme0n1p2";
};
};
}