Merge pull request #129408 from kurnevsky/swap-luks-discards

nixos/swap: allow luks discards if swap discards are enabled
This commit is contained in:
Jörg Thalheim 2021-07-23 11:11:04 +01:00 committed by GitHub
commit e2561ba61f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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