mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +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.
29 lines
825 B
Nix
29 lines
825 B
Nix
{ lib, config, ... }:
|
|
let
|
|
facterLib = import ./lib.nix lib;
|
|
|
|
inherit (config.hardware.facter) report;
|
|
in
|
|
{
|
|
options.hardware.facter.detected.boot.disk.kernelModules = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
default = lib.uniqueStrings (
|
|
facterLib.collectDrivers (
|
|
# A disk might be attached.
|
|
(report.hardware.firewire_controller or [ ])
|
|
# definitely important
|
|
++ (report.hardware.disk or [ ])
|
|
++ (report.hardware.storage_controller or [ ])
|
|
)
|
|
);
|
|
defaultText = "hardware dependent";
|
|
description = ''
|
|
List of kernel modules that are needed to access the disk.
|
|
'';
|
|
};
|
|
|
|
config = lib.mkIf config.hardware.facter.enable {
|
|
boot.initrd.availableKernelModules = config.hardware.facter.detected.boot.disk.kernelModules;
|
|
};
|
|
}
|