From a3621b1047be75b4b17c62ec51e6fa07b5a33041 Mon Sep 17 00:00:00 2001 From: obadz Date: Wed, 31 Aug 2016 15:29:11 +0100 Subject: [PATCH] =?UTF-8?q?nixos/=E2=80=A6/swap.nix:=20add=20some=20safety?= =?UTF-8?q?=20assertions=20for=20randomEncryption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nixos/modules/config/swap.nix | 2 ++ 1 file changed, 2 insertions(+) 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}";