about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilip Taron <philip.taron@gmail.com>2023-11-30 14:56:39 -0800
committerPhilip Taron <philip.taron@gmail.com>2023-11-30 14:56:39 -0800
commit28bb97817f2b8d0581dfcc513273e0dc04b6b0a1 (patch)
treede166b398c6de491c1338cc7dcfee718657c8f6a
parent8abf7c04993d786f5561d1c3ce35d0ebbc61ad1d (diff)
nixos/swap: ensure correct ordering w.r.t. shutdown.target
-rw-r--r--nixos/modules/config/swap.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix
index 8989a64082643..21046d6f1697b 100644
--- a/nixos/modules/config/swap.nix
+++ b/nixos/modules/config/swap.nix
@@ -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;