From c3d1e2f962ce0982141205300ff0c649ca5e3cd3 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Wed, 21 Feb 2024 13:47:45 -0600 Subject: [PATCH] move nas to internal ssd --- configuration-nas.nix | 20 +++++++++++---- hardware-configuration-nas.nix | 47 ++++++++++++++++++++++------------ nas-apps/jellyfin.nix | 6 ++--- nas-apps/jellyseerr.nix | 17 ++++++++++++ nas-apps/mariadb.nix | 2 +- nas-apps/nextcloud.nix | 6 ++--- nas-apps/radarr.nix | 6 ++--- nas-apps/sabnzbd.nix | 10 ++++---- nas-apps/sonarr.nix | 6 ++--- nas-apps/swag.nix | 4 +-- 10 files changed, 82 insertions(+), 42 deletions(-) create mode 100644 nas-apps/jellyseerr.nix diff --git a/configuration-nas.nix b/configuration-nas.nix index a1d075d..7a95fb6 100644 --- a/configuration-nas.nix +++ b/configuration-nas.nix @@ -22,6 +22,7 @@ in ./nas-apps/mariadb.nix ./nas-apps/nextcloud.nix ./nas-apps/collabora.nix + ./nas-apps/jellyseerr.nix ]; # Enable nix flakes and nix-command tools @@ -54,6 +55,7 @@ in supportedFilesystems = [ "zfs" ]; zfs.extraPools = [ "junk" ]; + zfs.requestEncryptionCredentials = false; }; # Hardware configs @@ -176,17 +178,20 @@ in systemd.services.nas-mounts = { path = [ pkgs.zfs pkgs.bash ]; script = '' - if test -d /mnt/Safe\ SSD/ssd_app_data; then + if test -d /mnt/ssd/ssd_app_data; then echo "NAS ZFS Pools Mounted." else - zpool import -R /mnt -f "Main Pool" - zpool import -R /mnt -f "Safe SSD" - zfs load-key -L file:///root/main-pool.key "Main Pool" - zfs load-key -L file:///root/safe-ssd.key "Safe SSD" + zpool import -f "MainPool" + zpool import -f "SSD" + zfs load-key -L file:///root/main-pool.key "MainPool" + zfs load-key -L file:///root/ssd.key "SSD" zfs mount -a echo "NAS ZFS Pools Mounted." fi ''; +# after = [ "zfs-import.target" ]; +# before = [ "zfs-mount.service" ]; +# wantedBy = [ "zfs-mount.target" ]; wantedBy = [ "multi-user.target" ]; }; @@ -199,6 +204,11 @@ in # Enable Network Manager networkmanager.enable = true; +# interfaces.enp7s0.ipv4.addresses = [ { +# address = "10.0.1.18"; +# prefixLength = 24; +# } ]; + firewall = { enable = true; allowPing = true; diff --git a/hardware-configuration-nas.nix b/hardware-configuration-nas.nix index 8a3de84..6acbe1b 100644 --- a/hardware-configuration-nas.nix +++ b/hardware-configuration-nas.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "mpt3sas" "xhci_pci" "ahci" "usb_storage" "uas" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "nvme" "mpt3sas" "xhci_pci" "ahci" "uas" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -19,48 +19,61 @@ }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/CDC4-6ECC"; + { device = "/dev/disk/by-uuid/C6E9-7371"; fsType = "vfat"; }; fileSystems."/nix" = - { device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7"; + { device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3"; fsType = "btrfs"; - options = [ "subvol=nix" ]; + options = [ "subvol=nix" "compress-force=zstd" "noatime" ]; }; fileSystems."/etc" = - { device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7"; + { device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3"; fsType = "btrfs"; - options = [ "subvol=etc" ]; - }; - - fileSystems."/var/log" = - { device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7"; - fsType = "btrfs"; - options = [ "subvol=log" ]; + options = [ "subvol=etc" "compress-force=zstd" "noatime" ]; }; fileSystems."/root" = - { device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7"; + { device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3"; fsType = "btrfs"; - options = [ "subvol=root" ]; + options = [ "subvol=root" "compress-force=zstd" "noatime" ]; + }; + + fileSystems."/var/log" = + { device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3"; + fsType = "btrfs"; + options = [ "subvol=log" "compress-force=zstd" "noatime" ]; }; fileSystems."/home" = - { device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7"; + { device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3"; fsType = "btrfs"; - options = [ "subvol=home" ]; + options = [ "subvol=home" "compress-force=zstd"]; }; - swapDevices = [ ]; + swapDevices = + [ { device = "/dev/disk/by-uuid/c08ba901-a8a9-4006-9688-002bb24da1b6"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; + # networking.interfaces.docker0.useDHCP = lib.mkDefault true; # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.podman0.useDHCP = lib.mkDefault true; + # networking.interfaces.veth0.useDHCP = lib.mkDefault true; + # networking.interfaces.veth1.useDHCP = lib.mkDefault true; + # networking.interfaces.veth2.useDHCP = lib.mkDefault true; + # networking.interfaces.veth3.useDHCP = lib.mkDefault true; + # networking.interfaces.veth4.useDHCP = lib.mkDefault true; + # networking.interfaces.veth5.useDHCP = lib.mkDefault true; + # networking.interfaces.veth6.useDHCP = lib.mkDefault true; + # networking.interfaces.veth7.useDHCP = lib.mkDefault true; + # networking.interfaces.vethd3ca67e.useDHCP = lib.mkDefault true; # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/nas-apps/jellyfin.nix b/nas-apps/jellyfin.nix index ac66664..7aede21 100644 --- a/nas-apps/jellyfin.nix +++ b/nas-apps/jellyfin.nix @@ -56,9 +56,9 @@ -e 'NVIDIA_DRIVER_CAPABILITIES'='all' \ -e 'NVIDIA_VISIBLE_DEVICES'='all' \ -p 8096:8096 \ - -v '/mnt/jellyfin/jellyfin:/config' \ - -v '/mnt/movies/Movies:/data/movies' \ - -v '/mnt/tv/TV:/data/tv' \ + -v '/mnt/ssd/nix-app-data/jellyfin:/config' \ + -v '/mnt/mainpool/Movies:/data/movies' \ + -v '/mnt/mainpool/TV:/data/tv' \ lscr.io/linuxserver/jellyfin:latest ''; wantedBy = [ "multi-user.target" ]; diff --git a/nas-apps/jellyseerr.nix b/nas-apps/jellyseerr.nix new file mode 100644 index 0000000..66b929e --- /dev/null +++ b/nas-apps/jellyseerr.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: +{ + # jellyseerr + virtualisation.oci-containers.containers."jellyseerr" = { + autoStart = true; + image = "fallenbagel/jellyseerr"; + ports = [ "5055:5055" ]; + volumes = [ + "/mnt/ssd/ssd_app_data/jellyseerr:/config" + ]; + environment = { + PUID = "911"; + PGID = "1000"; + TZ = "America/Chicago"; + }; + }; +} diff --git a/nas-apps/mariadb.nix b/nas-apps/mariadb.nix index c75e82f..217547a 100644 --- a/nas-apps/mariadb.nix +++ b/nas-apps/mariadb.nix @@ -6,7 +6,7 @@ image = "linuxserver/mariadb"; ports = [ "3306:3306" ]; volumes = [ - "/mnt/Safe\ SSD/mariadb:/config" + "/mnt/ssd/mariadb:/config" ]; environment = { PUID = "911"; diff --git a/nas-apps/nextcloud.nix b/nas-apps/nextcloud.nix index 2a60101..d45774a 100644 --- a/nas-apps/nextcloud.nix +++ b/nas-apps/nextcloud.nix @@ -4,10 +4,10 @@ virtualisation.oci-containers.containers."nextcloud" = { autoStart = true; image = "linuxserver/nextcloud"; - ports = [ "9443:443" ]; + ports = [ "9443:443" "9880:80" ]; volumes = [ - "/mnt/Safe\ SSD/ssd_app_data/nextcloud:/config" - "/mnt/Main\ Pool/Nextcloud:/data" + "/mnt/ssd/ssd_app_data/nextcloud:/config" + "/mnt/mainpool/Nextcloud:/data" ]; environment = { PUID = "911"; diff --git a/nas-apps/radarr.nix b/nas-apps/radarr.nix index 0c3d6b6..8d5eb66 100644 --- a/nas-apps/radarr.nix +++ b/nas-apps/radarr.nix @@ -6,9 +6,9 @@ image = "linuxserver/radarr"; ports = [ "7878:7878" ]; volumes = [ - "/mnt/Safe\ SSD/ssd_app_data/radarr:/config" - "/mnt/Main\ Pool/Movies:/movies" - "/mnt/Safe\ SSD/ssd_app_data/downloads:/downloads" + "/mnt/ssd/ssd_app_data/radarr:/config" + "/mnt/mainpool/Movies:/movies" + "/mnt/ssd/ssd_app_data/downloads:/downloads" ]; environment = { PUID = "911"; diff --git a/nas-apps/sabnzbd.nix b/nas-apps/sabnzbd.nix index 10c85c7..4e912d6 100644 --- a/nas-apps/sabnzbd.nix +++ b/nas-apps/sabnzbd.nix @@ -6,11 +6,11 @@ image = "linuxserver/sabnzbd"; ports = [ "8080:8080" ]; volumes = [ - "/mnt/Safe\ SSD/ssd_app_data/sabnzbd:/config" - "/mnt/Main\ Pool/TV:/tv" - "/mnt/Main\ Pool/Movies:/movies" - "/mnt/Safe\ SSD/ssd_app_data/downloads:/downloads" - "/mnt/Safe\ SSD/ssd_app_data/downloads-incomplete:/downloads-incomplete" + "/mnt/ssd/ssd_app_data/sabnzbd:/config" + "/mnt/mainpool/TV:/tv" + "/mnt/mainpool/Movies:/movies" + "/mnt/ssd/ssd_app_data/downloads:/downloads" + "/mnt/ssd/ssd_app_data/downloads-incomplete:/downloads-incomplete" ]; environment = { PUID = "911"; diff --git a/nas-apps/sonarr.nix b/nas-apps/sonarr.nix index dc5e6e3..7502168 100644 --- a/nas-apps/sonarr.nix +++ b/nas-apps/sonarr.nix @@ -6,9 +6,9 @@ image = "linuxserver/sonarr"; ports = [ "8989:8989" ]; volumes = [ - "/mnt/Safe\ SSD/ssd_app_data/sonarr:/config" - "/mnt/Main\ Pool/TV:/tv" - "/mnt/Safe\ SSD/ssd_app_data/downloads:/downloads" + "/mnt/ssd/ssd_app_data/sonarr:/config" + "/mnt/mainpool/TV:/tv" + "/mnt/ssd/ssd_app_data/downloads:/downloads" ]; environment = { PUID = "911"; diff --git a/nas-apps/swag.nix b/nas-apps/swag.nix index ac6b20f..d3897e3 100644 --- a/nas-apps/swag.nix +++ b/nas-apps/swag.nix @@ -6,7 +6,7 @@ image = "linuxserver/swag"; ports = [ "80:80" "443:443" ]; volumes = [ - "/mnt/Safe\ SSD/ssd_app_data/swag:/config" + "/mnt/ssd/ssd_app_data/swag:/config" ]; environment = { PGID = "1000"; @@ -15,7 +15,7 @@ TZ = "America/Chicago"; URL = "mjallen.dev"; VALIDATION = "http"; - SUBDOMAINS = "jellyfin,hass,cloud,jellyseer"; + SUBDOMAINS = "jellyfin,hass,cloud,office,jellyseerr"; }; }; }