nixos/security.lockKernelModules: remove with lib;

This commit is contained in:
Felix Buehler 2024-12-08 13:18:22 +01:00
parent 264f1b4941
commit 97b9c7bfcc

View File

@ -1,15 +1,12 @@
{ config, lib, ... }:
with lib;
{
meta = {
maintainers = [ maintainers.joachifm ];
maintainers = [ lib.maintainers.joachifm ];
};
options = {
security.lockKernelModules = mkOption {
type = types.bool;
security.lockKernelModules = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Disable kernel module loading once the system is fully initialised.
@ -20,9 +17,9 @@ with lib;
};
};
config = mkIf config.security.lockKernelModules {
boot.kernelModules = concatMap (x:
optionals (x.device != null) (
config = lib.mkIf config.security.lockKernelModules {
boot.kernelModules = lib.concatMap (x:
lib.optionals (x.device != null) (
if x.fsType == "vfat"
then [ "vfat" "nls-cp437" "nls-iso8859-1" ]
else [ x.fsType ])