From 9bd5a43d9926920ec08d8c20700fd94f262af799 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Fri, 20 Sep 2024 12:01:55 +0200 Subject: [PATCH] Avoid duplicating modules in the list of initrd modules Functionally this doesn't change anything as they get deduplicated during the initrd build anyway, but when inspecting values in the repl or running nix-diff, it's kind of ugly to see the same module repeated 4 times. --- modules/nixos/boot.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/nixos/boot.nix b/modules/nixos/boot.nix index 00d8102..3453d6d 100644 --- a/modules/nixos/boot.nix +++ b/modules/nixos/boot.nix @@ -13,16 +13,16 @@ in with lib; mkIf cfg.enable { boot.initrd.availableKernelModules = filter (dm: dm != null) ( - map - ( - { - driver_module ? null, - ... - }: - driver_module - ) - ( - unique (flatten [ + unique ( + map + ( + { + driver_module ? null, + ... + }: + driver_module + ) + (flatten [ # Needed if we want to use the keyboard when things go wrong in the initrd. (report.hardware.usb_controller or [ ]) # A disk might be attached. @@ -31,7 +31,7 @@ in (report.hardware.disk or [ ]) (report.hardware.storage_controller or [ ]) ]) - ) + ) ); }; }