systemd: move systemd-tmpfiles-setup-dev.service back to early boot

It was originally moved because of nixops autoLuks feature which
has been unsupported for a while.

See:
* https://github.com/NixOS/nixpkgs/issues/62211
* https://github.com/NixOS/nixops/pull/1156#issuecomment-605339705

systemd-tmpfiles-setup-dev.service needs to run very  early (even before
udev runs) because udev rules assume static device nodes already exist
even before udev is started. If these static device nodes do not exist;
systemd might have trouble mounting filesystems that require static
device nodes (like loopfs and btrfs).
This commit is contained in:
Arian van Putten 2021-04-28 19:37:07 +02:00 committed by ajs124
parent 32e30e84f6
commit d4e4d27dff

View File

@ -575,12 +575,6 @@ stdenv.mkDerivation {
'';
postInstall = ''
# sysinit.target: Don't depend on
# systemd-tmpfiles-setup.service. This interferes with NixOps's
# send-keys feature (since sshd.service depends indirectly on
# sysinit.target).
mv $out/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup-dev.service $out/lib/systemd/system/multi-user.target.wants/
mkdir -p $out/example/systemd
mv $out/lib/{modules-load.d,binfmt.d,sysctl.d,tmpfiles.d} $out/example
mv $out/lib/systemd/{system,user} $out/example/systemd