Open midirhee12 opened 4 months ago
I don't understand the request here; shouldn't that be on the user to ensure that they either have a valid mount configuration and/or make use of systemd-tmpfiles to create paths that don't exist?
Is there something I need to clarify? I can try rewording it maybe if you quote it.
Regarding the second statement, there's a number of reasons:
systemd-tmpfiles
is invoked after the NFS and Samba shares are created. This means that the NFS and Samba share options will error out without building correctly. If the directory paths are created ahead of time, the NFS and Samba services will correctly bind to the export path.If this was possible with tmpfiles
, I would agree with you that this is up to user configuration instead of the responsibility of NixOS. But in the current state, this is not true. I can see where you're coming from though.
Forgot to mention: @eclairevoyant . Sorry, you probably wanted the ping.
Motivation
For any given configuration with an NFS or Samba service defined, the configuration cannot be used to install NixOS. The services must be disabled first because the paths that NFS or Samba are trying to share do not exist. This requires the system to have a separate install configuration from their production configuration requiring two rebuilds and some external script to create the paths. This is both annoying to maintain and breaks the chain of reproducibility that NixOS has much success with. I believe its integral to the design of NixOS to favor creating such paths for the ability to install with a single configuration and also to not rely on external scripts.
Issue Description
There should be a NixOS option for both NFS and Samba configuration to automatically create respective share paths. This could be named something like
services.nfs.server.autoCreate
andservices.samba.autoCreate
which would either be of an enable option type or a list of paths to create during build. This doesn't seem too outside the scope of NixOS with other configurations such asenvironment.etc
andsystemd.tmpfiles
/systemd.user.tmpfiles
.