Mounting encrypted drive with pam_mount

I couldn’t find any guide on how to use pam_mount on NixOS, so I was hoping you could help me out.

I have a luks encrypted drive that has the same password as my user account. The Arch Wiki has a guide on how to mount such a drive on login, but that doesn’t work on NixOS.

Where do I start?

Do I have to make a fileSystems-entry in configuration.nix? If so, what parameters should I fill in?

Do I use security.pam.mount.extraVolumes, or extraUserVolumes? And how do I even use those?