0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

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