diff --git a/pkgs/os-specific/linux/systemd/0005-kmod-static-nodes.service-Don-t-require-lib-modules.patch b/pkgs/os-specific/linux/systemd/0005-kmod-static-nodes.service-Don-t-require-lib-modules.patch deleted file mode 100644 index 6d4f39ea4a30..000000000000 --- a/pkgs/os-specific/linux/systemd/0005-kmod-static-nodes.service-Don-t-require-lib-modules.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 18863cea3bdfad5f8b0581478ce4a39ede53b9d4 Mon Sep 17 00:00:00 2001 -From: Eelco Dolstra -Date: Thu, 17 Apr 2014 13:54:29 +0200 -Subject: [PATCH 05/27] kmod-static-nodes.service: Don't require /lib/modules - ---- - units/kmod-static-nodes.service.in | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in -index 0971edf9ec..7d150bf3d7 100644 ---- a/units/kmod-static-nodes.service.in -+++ b/units/kmod-static-nodes.service.in -@@ -12,7 +12,6 @@ Description=Create list of static device nodes for the current kernel - DefaultDependencies=no - Before=sysinit.target systemd-tmpfiles-setup-dev.service - ConditionCapability=CAP_SYS_MODULE --ConditionFileNotEmpty=/lib/modules/%v/modules.devname - - [Service] - Type=oneshot --- -2.24.1 - diff --git a/pkgs/os-specific/linux/systemd/0024-kmod-static-nodes.service-Update-ConditionFileNotEmpty.patch b/pkgs/os-specific/linux/systemd/0024-kmod-static-nodes.service-Update-ConditionFileNotEmpty.patch new file mode 100644 index 000000000000..df16b52660bf --- /dev/null +++ b/pkgs/os-specific/linux/systemd/0024-kmod-static-nodes.service-Update-ConditionFileNotEmpty.patch @@ -0,0 +1,27 @@ +From 7db89c2236158461c99fe5c5da7ddb7feab825cf Mon Sep 17 00:00:00 2001 +From: Florian Klink +Date: Sat, 7 Mar 2020 22:40:27 +0100 +Subject: [PATCH] kmod-static-nodes.service: Update ConditionFileNotEmpty + +On NixOS, kernel modules of the currently booted systems are located at +/run/booted-system/kernel-modules/lib/modules/%v/, not /lib/modules/%v/. +--- + units/kmod-static-nodes.service.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in +index 0971edf9ec..87105a87b9 100644 +--- a/units/kmod-static-nodes.service.in ++++ b/units/kmod-static-nodes.service.in +@@ -12,7 +12,7 @@ Description=Create list of static device nodes for the current kernel + DefaultDependencies=no + Before=sysinit.target systemd-tmpfiles-setup-dev.service + ConditionCapability=CAP_SYS_MODULE +-ConditionFileNotEmpty=/lib/modules/%v/modules.devname ++ConditionFileNotEmpty=/run/booted-system/kernel-modules/lib/modules/%v/modules.devname + + [Service] + Type=oneshot +-- +2.25.1 + diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 427c48a32e3b..c09db7e8ab0a 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -46,7 +46,6 @@ in stdenv.mkDerivation { ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch ./0003-Don-t-try-to-unmount-nix-or-nix-store.patch ./0004-Fix-NixOS-containers.patch - ./0005-kmod-static-nodes.service-Don-t-require-lib-modules.patch ./0006-Look-for-fsck-in-the-right-place.patch ./0007-Add-some-NixOS-specific-unit-directories.patch ./0009-Get-rid-of-a-useless-message-in-user-sessions.patch @@ -61,6 +60,7 @@ in stdenv.mkDerivation { ./0021-add-rootprefix-to-lookup-dir-paths.patch ./0022-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch ./0023-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch + ./0024-kmod-static-nodes.service-Update-ConditionFileNotEmpty.patch ]; outputs = [ "out" "lib" "man" "dev" ];