nixos/lock-kernel-modules: fix deferred fileSystem mounts

Ensure that modules required by all declared fileSystems are explicitly
loaded. A little ugly but fixes the deferred mount test.

See also https://github.com/NixOS/nixpkgs/issues/29019

+8
+8
nixos/modules/security/lock-kernel-modules.nix
··· 17 17 }; 18 18 19 19 config = mkIf config.security.lockKernelModules { 20 + boot.kernelModules = concatMap (x: 21 + if x.device != null 22 + then 23 + if x.fsType == "vfat" 24 + then [ "vfat" "nls-cp437" "nls-iso8859-1" ] 25 + else [ x.fsType ] 26 + else []) config.system.build.fileSystems; 27 + 20 28 systemd.services.disable-kernel-module-loading = rec { 21 29 description = "Disable kernel module loading"; 22 30