nixos/systemd: fix modprobe

Upstream systemd changed how modprobe is discovered. It is now searched
for on path. Thus, add the kmod package to the ExecSearchPath of the
modprobe@.service.
This commit is contained in:
nikstur
2026-04-07 00:01:29 +02:00
parent ab4b7fa170
commit d36077c0b6
2 changed files with 9 additions and 0 deletions

View File

@@ -792,6 +792,10 @@ in
path = [ pkgs.util-linux ];
overrideStrategy = "asDropin";
};
systemd.services."modprobe@" = {
restartIfChanged = false;
serviceConfig.ExecSearchPath = lib.makeBinPath [ pkgs.kmod ];
};
systemd.services.systemd-random-seed.restartIfChanged = false;
systemd.services.systemd-remount-fs.restartIfChanged = false;
systemd.services.systemd-update-utmp.restartIfChanged = false;

View File

@@ -60,5 +60,10 @@ in
machine.succeed("systemctl status example.service | grep 'Active: active'")
machine.succeed("systemctl show --property TasksMax --value user-1000.slice | grep 100")
with subtest("modprobe@ services work"):
modprobe_service_status = machine.succeed("systemctl show --property ExecMainStatus modprobe@configfs.service")
print(modprobe_service_status)
t.assertEqual("ExecMainStatus=0\n", modprobe_service_status)
'';
}