Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ in
systemd.services.systemd-importd.environment = proxy_env;
systemd.services.systemd-pstore.wantedBy = [ "sysinit.target" ]; # see #81138

# NixOS has kernel modules in a different location
systemd.services.kmod-static-nodes.unitConfig.ConditionFileNotEmpty = "/run/booted-system/kernel-modules/lib/modules/%v/modules.devname";

# Don't bother with certain units in containers.
systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container";
systemd.services.systemd-random-seed.unitConfig.ConditionVirtualization = "!container";
Expand Down
4 changes: 4 additions & 0 deletions nixos/modules/system/boot/systemd/initrd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ in {
services."systemd-makefs@" = lib.mkIf needMakefs { unitConfig.IgnoreOnIsolate = true; };
services."systemd-growfs@" = lib.mkIf needGrowfs { unitConfig.IgnoreOnIsolate = true; };

# make sure all the /dev nodes are set up
services.kmod-static-nodes.unitConfig.ConditionFileNotEmpty = "/lib/modules/%v/modules.devname";
services.systemd-tmpfiles-setup-dev.wantedBy = ["sysinit.target"];

services.initrd-nixos-activation = {
after = [ "initrd-fs.target" ];
requiredBy = [ "initrd.target" ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ index 777e82d16b..b6abc2bba0 100644
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.34.0