I create a separate volume for storing my files/codes/dotfiles. Then for every reformat, I just need to symlink my dotfiles to recover my working station.
We need to create a directory at root level in order for a volume to mount to. This is not possible since Catalina as they become read only.
So we need to add the directory that we want to /etc/synthetic.conf
.
For example
xi@XIL /zz % sudo cat /etc/synthetic.conf
nix
zz <-- this is the added directory
REBOOT and ensure the directory is created at /zz
Now configure the auto-mount upon boot.
We use sudo vifs
. This way we don't need to know the actual location of fstab.
# sudo vifs
### Option 1
LABEL=Nix\040Store /nix apfs rw,nobrowse
### Option 2 (retrieve UUID from diskutil list and diskutil info drive)
UUID=EE0A1841-6FD2-4EE3-A40F-F07261B9BF5F /zz apfs rw,nobrowse
Reboot!