nixos/swap: require mkswap when encrypted

the mkswap service manages a dm/luks block device when randomEncryption
is enabled, and is not an optional dependency of the swap unit
This commit is contained in:
arcnmx 2023-02-08 13:35:14 -08:00 committed by Masum Reza
parent 48066b94cd
commit 41725bb0f7

View file

@ -277,6 +277,7 @@ in
# avoid this race condition.
after = [ "systemd-modules-load.service" ];
wantedBy = [ "${realDevice'}.swap" ];
requiredBy = lib.optionals sw.randomEncryption.enable [ "${realDevice'}.swap" ];
before = [
"${realDevice'}.swap"
"shutdown.target"