nixos/udev: only load firmware from udev when the nixos kernel is used

This is not the case for eg. NixOS in WSL
This commit is contained in:
Sandro Jäckel 2024-04-02 18:14:50 +02:00
parent 413f779bc0
commit 4677729c56
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 10 additions and 12 deletions

View File

@ -421,19 +421,17 @@ in
(isYes "NET")
];
system.activationScripts.udevd = lib.mkIf config.boot.kernel.enable ''
# The deprecated hotplug uevent helper is not used anymore
if [ -e /proc/sys/kernel/hotplug ]; then
echo "" > /proc/sys/kernel/hotplug
fi
system.activationScripts.udevd =
''
# The deprecated hotplug uevent helper is not used anymore
if [ -e /proc/sys/kernel/hotplug ]; then
echo "" > /proc/sys/kernel/hotplug
fi
# Allow the kernel to find our firmware.
if [ -e /sys/module/firmware_class/parameters/path ]; then
echo -n "${config.hardware.firmware}/lib/firmware" > /sys/module/firmware_class/parameters/path
fi
'';
# Allow the kernel to find our firmware.
if [ -e /sys/module/firmware_class/parameters/path ]; then
echo -n "${config.hardware.firmware}/lib/firmware" > /sys/module/firmware_class/parameters/path
fi
'';
systemd.services.systemd-udevd =
{ restartTriggers = cfg.packages;