From 11c0384bf0563718806e92d83fbd23e588231f10 Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Tue, 6 Jul 2021 10:18:58 +0300 Subject: [PATCH] nixos/swap: allow luks discards if swap discards are enabled --- nixos/modules/config/swap.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix index a37b46b8c468..faf4d2bde74b 100644 --- a/nixos/modules/config/swap.nix +++ b/nixos/modules/config/swap.nix @@ -215,7 +215,7 @@ in fi ''} ${optionalString sw.randomEncryption.enable '' - cryptsetup plainOpen -c ${sw.randomEncryption.cipher} -d ${sw.randomEncryption.source} ${sw.device} ${sw.deviceName} + cryptsetup plainOpen -c ${sw.randomEncryption.cipher} -d ${sw.randomEncryption.source} ${optionalString (sw.discardPolicy != null) "--allow-discards"} ${sw.device} ${sw.deviceName} mkswap ${sw.realDevice} ''} '';