diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix index 968bb22f354c..e57ed2565a10 100644 --- a/nixos/modules/config/swap.nix +++ b/nixos/modules/config/swap.nix @@ -125,6 +125,8 @@ in createSwapDevice = sw: assert sw.device != ""; + assert !(sw.randomEncryption && lib.hasPrefix "/dev/disk/by-uuid" sw.device); + assert !(sw.randomEncryption && lib.hasPrefix "/dev/disk/by-label" sw.device); let realDevice' = escapeSystemdPath sw.realDevice; in nameValuePair "mkswap-${sw.deviceName}" { description = "Initialisation of swap device ${sw.device}";