nixpkgs-suyu/modules/services/hardware/firmware.nix
Eelco Dolstra 167ccdd537 * Move the firmware loader into a separate module.
* services.udev.addFirmware -> hardware.firmware.

svn path=/nixos/trunk/; revision=16657
2009-08-10 19:27:15 +00:00

51 lines
971 B
Nix

# This module provides support for automatic loading of firmware from
# kernel modules.
{pkgs, config, ...}:
with pkgs.lib;
let
firmwareLoader = pkgs.substituteAll {
src = ./udev-firmware-loader.sh;
path = "${pkgs.coreutils}/bin";
isExecutable = true;
firmwareDirs = config.hardware.firmware;
};
in
{
###### interface
options = {
hardware.firmware = mkOption {
default = [];
example = ["/root/my-firmware"];
merge = mergeListOption;
description = ''
List of directories containing firmware files. Such files
will be loaded automatically if the kernel asks for them
(i.e., when it has detected specific hardware that requires
firmware to function).
'';
};
};
###### implementation
config = {
services.udev.extraRules =
''
# Firmware loading.
SUBSYSTEM=="firmware", ACTION=="add", RUN+="${firmwareLoader}"
'';
};
}