NFS: Difference between revisions

imported>Patryk27
No edit summary
imported>Patryk27
mNo edit summary
Line 10: Line 10:
</syntaxhighlight>
</syntaxhighlight>


Then we have to either move our already-existing directories inside <code>/export</code> or bind-mount them there:
Then we have to either move our already-existing directories inside <code>/export</code> (using <code>mv</code> from the command line) or bind-mount them there:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 36: Line 36:
</syntaxhighlight>
</syntaxhighlight>


Having the filesystem ready, we can proceed to configure our NFS server:
Having the filesystem ready, we can proceed to configure the NFS server itself:


<syntaxhighlight lang="nix">{
<syntaxhighlight lang="nix">{
Line 48: Line 48:
   '';
   '';
}</syntaxhighlight>
}</syntaxhighlight>
This configuration exports all our shares to 2 local IPs; Gentoo's wiki has a great article [https://wiki.gentoo.org/wiki/NFSv4#Server Gentoo wiki NFSv4 article] that covers typical settings, so we won't repeat them here.
This configuration exposes all our shares to 2 local IPs; you can find more examples at Gentoo's wiki [https://wiki.gentoo.org/wiki/NFSv4].


Other options are available on the [https://search.nixos.org/options?query=nfs NixOS option page] or via the <code>nixos-option</code> command.
Other options are available on the [https://search.nixos.org/options?query=nfs NixOS option page] or via the <code>nixos-option</code> command.