nixos/modules/luks.nix

23 lines
554 B
Nix
Raw Normal View History

2024-07-14 06:13:04 +00:00
{ config, ... }:
{
boot.initrd.kernelModules = [ "usb_storage" ];
boot.initrd.luks.devices = {
"${config.networking.hostName}-luks0" = {
device = "/dev/disk/by-partlabel/${config.networking.hostName}-luks0";
allowDiscards = true;
keyFileSize = 32;
keyFile = "/dev/zero";
};
};
fileSystems."/" = {
device = "/dev/disk/by-label/${config.networking.hostName}-root";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
}