mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-13 02:39:58 +00:00
The option defaults to `report != { }` instead of `reportPath != null`,
because since the report may be set externally using `report`, guarding
for `reportPath != null` breaks setups that set it externally, since
none of the modules take effect any longer.
21 lines
700 B
Nix
21 lines
700 B
Nix
{ lib, config, ... }:
|
|
let
|
|
facterLib = import ../lib.nix lib;
|
|
|
|
inherit (config.hardware.facter) report;
|
|
in
|
|
{
|
|
options.hardware.facter.detected.boot.initrd.networking.kernelModules = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
default = lib.uniqueStrings (facterLib.collectDrivers (report.hardware.network_controller or [ ]));
|
|
defaultText = "hardware dependent";
|
|
description = ''
|
|
List of kernel modules to include in the initrd to support networking.
|
|
'';
|
|
};
|
|
|
|
config = lib.mkIf (config.hardware.facter.enable && config.boot.initrd.network.enable) {
|
|
boot.initrd.kernelModules = config.hardware.facter.detected.boot.initrd.networking.kernelModules;
|
|
};
|
|
}
|