Skip to content

Commit

Permalink
Avoid duplicating modules in the list of initrd modules
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
r-vdp committed Sep 20, 2024
1 parent cc817a8 commit 9bd5a43
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions modules/nixos/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -31,7 +31,7 @@ in
(report.hardware.disk or [ ])
(report.hardware.storage_controller or [ ])
])
)
)
);
};
}

0 comments on commit 9bd5a43

Please sign in to comment.