nixos/swap: ensure correct ordering w.r.t. shutdown.target

This commit is contained in:
Philip Taron 2023-11-30 14:56:39 -08:00
parent 8abf7c0499
commit 28bb97817f
No known key found for this signature in database

View File

@ -258,7 +258,8 @@ in
# avoid this race condition.
after = [ "systemd-modules-load.service" ];
wantedBy = [ "${realDevice'}.swap" ];
before = [ "${realDevice'}.swap" ];
before = [ "${realDevice'}.swap" "shutdown.target"];
conflicts = [ "shutdown.target" ];
path = [ pkgs.util-linux pkgs.e2fsprogs ]
++ optional sw.randomEncryption.enable pkgs.cryptsetup;