Cannot encrypt home folder using ecryptfs-migrate-home

I’m trying to encrypt my NixOS (23.11) home folder.

I am following the advice on the wiki page about ECryptfs. After running ecryptfs-migrate-home as root, I have an error saying that /etc/fstab is read only. Indeed, it is read only because the file is dynamically generated. There is a comment saying so in the file itself. This makes the command fail.

So, what can I do in these circumstances to make ecryptfs-migrate-home work again and avoid the previous described problem?

It turns out my home directory was encrypted. I thought it was not because it was still accessible when I was logged out. The home directory is mounted when I log in, and it stays mounted even after I log out.