I wanted to try to abstract NFS mounting in my configuration files, but – as I am new to nix – I have troubles with the mount point and passing strings to it.
Basically, I want to have something like this (with several more folders):
What you have won’t quite work for the fileSystems option. It expects either an attrset whose keys are mount points and values are the various FS settings, or a list of FS settings that include a mountPoint = "..."; setting. So rather than:
@jonringer: thanks a lot for your answer, and sorry for that basic syntax error. @ElvishJerricco: that was exactly what I needed, thanks – that solved my problem. I thought that the mountPoint had to be parent to submodules device and fsType – at least that’s what I guessed from the fileSystems.<name?>.* syntax in the NixOS-options. That is way more convenient for me like that.
However, I don’t know if I should open another topic, but my system is booting more slowly automounting my NFS directories, all the more if I am not connected to my network (and that I know it will fail…). I tried to put this option: