From 4101d3b56fed568b8ec52046f13bd57c9ba266f9 Mon Sep 17 00:00:00 2001 From: Mikaela Allan Date: Tue, 16 May 2023 09:32:53 -0400 Subject: [PATCH] nixos/config/swap: resolve swapfile issue !232229 --- nixos/modules/config/swap.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix index 5c812a9226e8..0a7e45bffb26 100644 --- a/nixos/modules/config/swap.nix +++ b/nixos/modules/config/swap.nix @@ -275,12 +275,11 @@ in ''} ${optionalString sw.randomEncryption.enable '' cryptsetup plainOpen -c ${sw.randomEncryption.cipher} -d ${sw.randomEncryption.source} \ - '' + concatMapStrings (arg: arg + " \\\n") (flatten [ - (optional (sw.randomEncryption.sectorSize != null) "--sector-size=${toString sw.randomEncryption.sectorSize}") - (optional (sw.randomEncryption.keySize != null) "--key-size=${toString sw.randomEncryption.keySize}") - (optional sw.randomEncryption.allowDiscards "--allow-discards") - ]) + '' - ${sw.device} ${sw.deviceName} + ${concatStringsSep " \\\n" (flatten [ + (optional (sw.randomEncryption.sectorSize != null) "--sector-size=${toString sw.randomEncryption.sectorSize}") + (optional (sw.randomEncryption.keySize != null) "--key-size=${toString sw.randomEncryption.keySize}") + (optional sw.randomEncryption.allowDiscards "--allow-discards") + ])} ${sw.device} ${sw.deviceName} mkswap ${sw.realDevice} ''} '';