systemd/initrd: Add TPM modules into initrd

This improves the out-of-box experience of TPM2 unlocking at a
small (50K) overhead.

Changed files
+4 -1
nixos
modules
system
boot
systemd
+4 -1
nixos/modules/system/boot/systemd/initrd.nix
···
config = mkIf (config.boot.initrd.enable && cfg.enable) {
system.build = { inherit initialRamdisk; };
-
boot.initrd.availableKernelModules = [ "autofs4" ]; # systemd needs this for some features
+
boot.initrd.availableKernelModules = [
+
"autofs4" # systemd needs this for some features
+
"tpm-tis" "tpm-crb" # systemd-cryptenroll
+
];
boot.initrd.systemd = {
initrdBin = [pkgs.bash pkgs.coreutils cfg.package.kmod cfg.package] ++ config.system.fsPackages;