From 88902c97050fd66059feab31b5d03e7d81eeed45 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Wed, 16 Oct 2024 11:40:45 -0700 Subject: Add NFS server @arrakis --- hosts/arrakis/hardware-configuration.nix | 88 +++++++++++++++++++++----------- hosts/arrakis/services.nix | 9 ++++ 2 files changed, 68 insertions(+), 29 deletions(-) diff --git a/hosts/arrakis/hardware-configuration.nix b/hosts/arrakis/hardware-configuration.nix index 4e67e65..8a439ab 100644 --- a/hosts/arrakis/hardware-configuration.nix +++ b/hosts/arrakis/hardware-configuration.nix @@ -16,42 +16,72 @@ zfs.extraPools = [ "data" ]; }; - fileSystems."/" = - { device = "rpool/local/root"; - fsType = "zfs"; - }; + fileSystems."/" = { + device = "rpool/local/root"; + fsType = "zfs"; + }; - fileSystems."/efiboot/efi1" = - { device = "/dev/disk/by-label/ESP1"; - fsType = "vfat"; - options = [ "X-mount.mkdir" "iocharset=iso8859-1" ]; - }; + fileSystems."/efiboot/efi1" = { + device = "/dev/disk/by-label/ESP1"; + fsType = "vfat"; + options = [ "X-mount.mkdir" "iocharset=iso8859-1" ]; + }; - fileSystems."/efiboot/efi2" = - { device = "/dev/disk/by-label/ESP2"; - fsType = "vfat"; - options = [ "X-mount.mkdir" "iocharset=iso8859-1" ]; - }; + fileSystems."/efiboot/efi2" = { + device = "/dev/disk/by-label/ESP2"; + fsType = "vfat"; + options = [ "X-mount.mkdir" "iocharset=iso8859-1" ]; + }; - fileSystems."/nix" = - { device = "rpool/local/nix"; - fsType = "zfs"; - }; + fileSystems."/nix" = { + device = "rpool/local/nix"; + fsType = "zfs"; + }; - fileSystems."/root" = - { device = "rpool/user/home/root"; - fsType = "zfs"; - }; + fileSystems."/root" = { + device = "rpool/user/home/root"; + fsType = "zfs"; + }; - fileSystems."/home/nipsy" = - { device = "rpool/user/home/nipsy"; - fsType = "zfs"; - }; + fileSystems."/home/nipsy" = { + device = "rpool/user/home/nipsy"; + fsType = "zfs"; + }; + + fileSystems."/srv/nfs/keepers" = { + device = "/data/home/nipsy/downloads/keepers"; + options = [ + "bind" + "defaults" + "nofail" + "x-systemd.requires=zfs-mount.service" + ]; + }; - swapDevices = - [ { device = "/dev/disk/by-label/swap1"; } - { device = "/dev/disk/by-label/swap2"; } + fileSystems."/srv/nfs/movies" = { + device = "/data/home/nipsy/downloads/movies"; + options = [ + "bind" + "defaults" + "nofail" + "x-systemd.requires=zfs-mount.service" ]; + }; + + fileSystems."/srv/nfs/tv" = { + device = "/data/home/nipsy/downloads/tv"; + options = [ + "bind" + "defaults" + "nofail" + "x-systemd.requires=zfs-mount.service" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/swap1"; } + { device = "/dev/disk/by-label/swap2"; } + ]; hardware = { bluetooth.enable = true; diff --git a/hosts/arrakis/services.nix b/hosts/arrakis/services.nix index 79f614f..8054fb8 100644 --- a/hosts/arrakis/services.nix +++ b/hosts/arrakis/services.nix @@ -5,6 +5,8 @@ directory = * ''; + networking.firewall.allowedTCPPorts = [ 2049 ]; + security.acme = { acceptTerms = true; certs."arrakis.bitgnome.net".postRun = '' @@ -62,6 +64,13 @@ jellyfin.enable = true; + nfs.server = { + enable = true; + exports = '' + /srv/nfs 192.168.1.0/24(ro,all_squash,insecure,crossmnt,subtree_check,fsid=0) + ''; + }; + nginx = { enable = true; -- cgit v1.2.3