mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
24 lines
481 B
Nix
24 lines
481 B
Nix
|
# !!! Don't like it that I have to pass the kernel here.
|
||
|
{kernel, module_init_tools}:
|
||
|
|
||
|
{
|
||
|
name = "hardware-scan";
|
||
|
|
||
|
job = "
|
||
|
start on startup
|
||
|
|
||
|
script
|
||
|
export MODULE_DIR=${kernel}/lib/modules/
|
||
|
|
||
|
# Try to load modules for all PCI devices.
|
||
|
for i in /sys/bus/pci/devices/*/modalias; do
|
||
|
echo \"Trying to load a module for $(basename $(dirname $i))...\"
|
||
|
${module_init_tools}/sbin/modprobe $(cat $i) || true
|
||
|
echo \"\"
|
||
|
done
|
||
|
end script
|
||
|
|
||
|
";
|
||
|
|
||
|
}
|