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
This commit is contained in:
Joachim Fasting 2017-09-22 23:45:04 +02:00
parent bccaf63067
commit 1df6cf5d1d
No known key found for this signature in database
GPG Key ID: 66EAB6B14F6B6E0D

View File

@ -17,6 +17,14 @@ with lib;
};
config = mkIf config.security.lockKernelModules {
boot.kernelModules = concatMap (x:
if x.device != null
then
if x.fsType == "vfat"
then [ "vfat" "nls-cp437" "nls-iso8859-1" ]
else [ x.fsType ]
else []) config.system.build.fileSystems;
systemd.services.disable-kernel-module-loading = rec {
description = "Disable kernel module loading";