diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index d218aa1e5e1..875de55b6c6 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -243,5 +243,10 @@ in fi ''; + systemd.services.systemd-udevd = + { baseUnit = "${config.systemd.package}/example/systemd/system/systemd-udevd.service"; + environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; + }; + }; } diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index a35c3224db2..36d27356408 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -50,7 +50,7 @@ let # Udev. "systemd-udevd-control.socket" "systemd-udevd-kernel.socket" - "systemd-udevd.service" + #"systemd-udevd.service" "systemd-udev-settle.service" "systemd-udev-trigger.service" diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix index 0f57b9f6126..76298f1abd4 100644 --- a/nixos/tests/misc.nix +++ b/nixos/tests/misc.nix @@ -63,6 +63,12 @@ import ./make-test.nix { $machine->succeed('[ "`hostname`" = machine ]'); $machine->succeed('[ "`hostname -s`" = machine ]'); }; + + # Test whether systemd-udevd automatically loads modules for our hardware. + subtest "udev-auto-load", sub { + $machine->waitForUnit('systemd-udev-settle.service'); + $machine->succeed('lsmod | grep psmouse'); + }; ''; }