nixfiles/modules/nixos/encryptedDriveMod/kernelModules.nix

34 lines
600 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.lists) flatten optionals;
cfg = config.boot.encryptedDrive;
in {
2024-08-12 16:54:39 +01:00
config = mkIf cfg.enable {
boot.initrd.availableKernelModules =
flatten
[
# For USB w/ Encryption Key
"usb_storage"
"usbcore"
"uas"
"rtsx_pci_sdmmc"
# For USB Keyboards
"usbhid"
"hid_generic"
# For Cryptography
"cryptd"
(optionals (pkgs.system == "x86_64_linux") [
"aesni_intel"
2024-08-12 17:01:18 +01:00
"crypto_simd"
])
];
};
}