Any reason not to share a read-only `/nix/store` mount between servers?

I am running a small HPC system on NixOS and I was facing a similar question when setting up the system. Despite several reports that exporting the nix-store via NFS can work I could not get comfortable with the idea of tying a central part of the OS to NFS (mainly of all the reasons mentioned by @alexv).
Instead I chose to de-centralize the nix store: My master/login node acts as a cache for the compute nodes (via nix-serve). When I run “nix-build -A” , “nix-shell -p”, or “nix-store --realise” for a specific path or package I get it automatically on the compute node from which I am running the command. In that way there is no need for replicating the whole store for all nodes and I do not need to keep track of a sync status.

1 Like