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
commit1df6cf5d1d6d4fa092252275ab82f409dd8f79fe
authorJoachim Fasting <joachifm@fastmail.fm>
dateFri 22 Sep 2017, 23:45 (9 years ago)
parentbccaf63
nixos/modules/security/lock-kernel-modules.nix+8
@@ -17,6 +17,14 @@ with lib;
1717 };
1818
1919 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+
2028 systemd.services.disable-kernel-module-loading = rec {
2129 description = "Disable kernel module loading";
2230