From 13b2821dd3f519f959e054a8822a5abce7d0cdba Mon Sep 17 00:00:00 2001 From: willifan Date: Sat, 19 Oct 2024 23:26:42 +0200 Subject: [PATCH] added NFS server --- hosts/Anton/default.nix | 1 + hosts/Anton/nfs.nix | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 hosts/Anton/nfs.nix diff --git a/hosts/Anton/default.nix b/hosts/Anton/default.nix index d2aaff5..805a3eb 100644 --- a/hosts/Anton/default.nix +++ b/hosts/Anton/default.nix @@ -12,6 +12,7 @@ ./homeassistant.nix ./invidious.nix ./minecraft.nix + ./nfs.nix ./radicale.nix ./syncthing.nix diff --git a/hosts/Anton/nfs.nix b/hosts/Anton/nfs.nix new file mode 100644 index 0000000..5e4c299 --- /dev/null +++ b/hosts/Anton/nfs.nix @@ -0,0 +1,21 @@ +{ ... }: +{ + + fileSystems = { + "/export/roms" = { + device = "/mnt/data/willifan"; + options = [ "bind" ]; + }; + }; + + services.nfs.server = { + enable = true; + exports = '' + /export *(rw,fsid=0,no_subtree_check) + /export/roms *(rw,nohide,insecure,no_subtree_check) + ''; + }; + + networking.firewall.allowedTCPPorts = [ 2049 ]; + +}