Self Encryption Drive
From NixOS Wiki
To encrypt your drive using the OPAL standard that many modern storage devices implement you have to follow the instructions on this page: https://github.com/Drive-Trust-Alliance/sedutil/wiki/Encrypting-your-drive
The relevant configuration bits for NixOS are here: https://gist.github.com/callahad/a42d1e7edeaffa68517405e35a173b56
Kernels since 19.03 do have the necessary option CONFIG_BLK_SED_OPAL to let this work on suspend/resume. See https://github.com/NixOS/nixpkgs/pull/56147
Please be aware that the use of this encryption raises some security concerns and maybe vulnerable to a number of security attacks, see: