treewide: use optional instead of 'then []'

This commit is contained in:
Felix Buehler
2023-06-25 11:47:43 +02:00
committed by Anderson Torres
parent 175e9d1f00
commit 933a41a73f
17 changed files with 45 additions and 65 deletions

View File

@@ -22,12 +22,11 @@ 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;
optionals (x.device != null) (
if x.fsType == "vfat"
then [ "vfat" "nls-cp437" "nls-iso8859-1" ]
else [ x.fsType ])
) config.system.build.fileSystems;
systemd.services.disable-kernel-module-loading = {
description = "Disable kernel module loading";