Merge pull request #145050 from bb2020/swap

authored by

Sandro and committed by
GitHub
1d30bfc9 7c661452

+11 -1
+11 -1
nixos/modules/config/swap.nix
··· 47 ''; 48 }; 49 50 }; 51 52 }; ··· 224 fi 225 ''} 226 ${optionalString sw.randomEncryption.enable '' 227 - cryptsetup plainOpen -c ${sw.randomEncryption.cipher} -d ${sw.randomEncryption.source} ${optionalString (sw.discardPolicy != null) "--allow-discards"} ${sw.device} ${sw.deviceName} 228 mkswap ${sw.realDevice} 229 ''} 230 '';
··· 47 ''; 48 }; 49 50 + allowDiscards = mkOption { 51 + default = false; 52 + type = types.bool; 53 + description = '' 54 + Whether to allow TRIM requests to the underlying device. This option 55 + has security implications; please read the LUKS documentation before 56 + activating it. 57 + ''; 58 + }; 59 }; 60 61 }; ··· 233 fi 234 ''} 235 ${optionalString sw.randomEncryption.enable '' 236 + cryptsetup plainOpen -c ${sw.randomEncryption.cipher} -d ${sw.randomEncryption.source} \ 237 + ${optionalString sw.randomEncryption.allowDiscards "--allow-discards"} ${sw.device} ${sw.deviceName} 238 mkswap ${sw.realDevice} 239 ''} 240 '';