nixos/config/swap: resolve swapfile issue !232229

This commit is contained in:
Mikaela Allan 2023-05-16 09:32:53 -04:00
parent 9b47ad6682
commit 4101d3b56f
No known key found for this signature in database
GPG key ID: BC04913562575C81

View file

@ -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}
''}
'';