about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikaela Allan <me@mikaela.ca>2023-05-16 09:32:53 -0400
committerMikaela Allan <me@mikaela.ca>2023-05-16 10:48:53 -0400
commit4101d3b56fed568b8ec52046f13bd57c9ba266f9 (patch)
tree6b0d47bc84af03902c0b18b00eb51eec8055cf3c
parent9b47ad6682fbf3ba3c6ce006a54440e0126fdf04 (diff)
nixos/config/swap: resolve swapfile issue !232229
-rw-r--r--nixos/modules/config/swap.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix
index 5c812a9226e84..0a7e45bffb267 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}
                 ''}
               '';