From 60f0ab11bd75c3da70f2a01cda70e3214ba31720 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Fri, 15 Nov 2024 20:23:55 +0100 Subject: [PATCH] moves /mnt/20tb/ away to just /mnt --- .../nixos/docker/arr-stack/docker-compose.yml | 8 +- config/nixos/docker/default.nix | 26 ++--- config/nixos/docker/plex/docker-compose.yml | 6 +- .../nixos/docker/sabnzbd/docker-compose.yml | 2 +- config/nixos/docker/stash/docker-compose.yml | 2 +- .../nixos/docker/torrent/docker-compose.yml | 2 +- config/nixos/hardware/mennos-server.nix | 58 ++++++------ config/nixos/hardware/mennos-server/zfs.nix | 94 ++++++++++--------- 8 files changed, 97 insertions(+), 101 deletions(-) diff --git a/config/nixos/docker/arr-stack/docker-compose.yml b/config/nixos/docker/arr-stack/docker-compose.yml index 446ba2f..6c4a426 100644 --- a/config/nixos/docker/arr-stack/docker-compose.yml +++ b/config/nixos/docker/arr-stack/docker-compose.yml @@ -11,7 +11,7 @@ services: - host.docker.internal:host-gateway volumes: - ./data/radarr-config:/config - - /mnt/20tb:/storage + - /mnt:/storage restart: "unless-stopped" sonarr: @@ -21,7 +21,7 @@ services: - TZ=Europe/Amsterdam volumes: - ./data/sonarr-config:/config - - /mnt/20tb:/storage + - /mnt:/storage ports: - 8989:8989 extra_hosts: @@ -38,7 +38,7 @@ services: - host.docker.internal:host-gateway volumes: - ./data/lidarr-config:/config - - /mnt/20tb:/storage + - /mnt:/storage restart: unless-stopped whisparr: @@ -51,7 +51,7 @@ services: - host.docker.internal:host-gateway volumes: - ./data/whisparr-config:/config - - /mnt/20tb:/storage + - /mnt:/storage restart: unless-stopped prowlarr: diff --git a/config/nixos/docker/default.nix b/config/nixos/docker/default.nix index 8a5b0e9..7ee986b 100644 --- a/config/nixos/docker/default.nix +++ b/config/nixos/docker/default.nix @@ -1,18 +1,12 @@ -{ ... }: +{ config, pkgs, ... }: + +let + files = builtins.removeAttrs (builtins.readDir ./.) [ "default.nix" ]; + + # Import all other .nix files as modules + moduleFiles = builtins.map (fname: ./. + "/${fname}") (builtins.attrNames files); +in { - imports = [ - ./arr-stack.nix - ./duplicati.nix - ./factorio.nix - ./gitea.nix - ./golink.nix - ./immich.nix - ./minecraft.nix - ./plex.nix - ./sabnzbd.nix - ./satisfactory.nix - ./stash.nix - ./torrent.nix - ./wireguard.nix - ]; + # Import all the package modules + imports = moduleFiles; } diff --git a/config/nixos/docker/plex/docker-compose.yml b/config/nixos/docker/plex/docker-compose.yml index 53130d0..3d1e4cd 100644 --- a/config/nixos/docker/plex/docker-compose.yml +++ b/config/nixos/docker/plex/docker-compose.yml @@ -18,9 +18,9 @@ services: - NVIDIA_DRIVER_CAPABILITIES=compute,video,utility volumes: - ./data/plex:/config - - /mnt/20tb/Movies:/movies - - /mnt/20tb/TV_Shows:/tvshows - - /mnt/20tb/Music:/music + - /mnt/movies:/movies + - /mnt/tvshows:/tvshows + - /mnt/music:/music restart: unless-stopped tautulli: diff --git a/config/nixos/docker/sabnzbd/docker-compose.yml b/config/nixos/docker/sabnzbd/docker-compose.yml index 29e9b95..b9f7cfb 100644 --- a/config/nixos/docker/sabnzbd/docker-compose.yml +++ b/config/nixos/docker/sabnzbd/docker-compose.yml @@ -6,7 +6,7 @@ services: - TZ=Europe/Amsterdam volumes: - ./data:/config - - /mnt/20tb:/storage + - /mnt:/storage ports: - 7788:8080 restart: unless-stopped diff --git a/config/nixos/docker/stash/docker-compose.yml b/config/nixos/docker/stash/docker-compose.yml index 98d5115..82cd87c 100644 --- a/config/nixos/docker/stash/docker-compose.yml +++ b/config/nixos/docker/stash/docker-compose.yml @@ -17,7 +17,7 @@ services: ## Keep configs, scrapers, and plugins here. - ./data/config:/root/.stash ## Point this at your collection. - - /mnt/20tb/Stash:/data + - /mnt/stash:/data ## This is where your stash's metadata lives - ./data/metadata:/metadata ## Any other cache content. diff --git a/config/nixos/docker/torrent/docker-compose.yml b/config/nixos/docker/torrent/docker-compose.yml index fc7e0f4..b2aecec 100644 --- a/config/nixos/docker/torrent/docker-compose.yml +++ b/config/nixos/docker/torrent/docker-compose.yml @@ -29,7 +29,7 @@ services: volumes: - "/etc/localtime:/etc/localtime:ro" - ./data/qbit:/config - - /mnt/20tb:/storage + - /mnt:/storage depends_on: - gluetun restart: always diff --git a/config/nixos/hardware/mennos-server.nix b/config/nixos/hardware/mennos-server.nix index 8bffc09..58e58d3 100644 --- a/config/nixos/hardware/mennos-server.nix +++ b/config/nixos/hardware/mennos-server.nix @@ -16,42 +16,40 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # TODO: Enable this when I switch from test VM to actual hardware - # Enable OpenGL - # hardware.opengl.enable = true; + hardware.opengl.enable = true; - # # Load nvidia driver for Xorg and Wayland - # services.xserver.videoDrivers = [ "nvidia" ]; + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = [ "nvidia" ]; - # hardware.nvidia = { - # # Modesetting is required. - # modesetting.enable = true; + hardware.nvidia = { + # Modesetting is required. + modesetting.enable = true; - # # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # # Enable this if you have graphical corruption issues or application crashes after waking - # # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # # of just the bare essentials. - # powerManagement.enable = false; + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; - # # Fine-grained power management. Turns off GPU when not in use. - # # Experimental and only works on modern Nvidia GPUs (Turing or newer). - # powerManagement.finegrained = false; + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; - # # Use the NVidia open source kernel module (not to be confused with the - # # independent third-party "nouveau" open source driver). - # # Support is limited to the Turing and later architectures. Full list of - # # supported GPUs is at: - # # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # # Only available from driver 515.43.04+ - # # Currently alpha-quality/buggy, so false is currently the recommended setting. - # open = false; + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + # Currently alpha-quality/buggy, so false is currently the recommended setting. + open = false; - # # Enable the Nvidia settings menu, - # # accessible via `nvidia-settings`. - # nvidiaSettings = true; + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; - # # Optionally, you may need to select the appropriate driver version for your specific GPU. - # package = config.boot.kernelPackages.nvidiaPackages.stable; - # }; + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; } diff --git a/config/nixos/hardware/mennos-server/zfs.nix b/config/nixos/hardware/mennos-server/zfs.nix index 9aa334c..6098a7f 100644 --- a/config/nixos/hardware/mennos-server/zfs.nix +++ b/config/nixos/hardware/mennos-server/zfs.nix @@ -23,62 +23,67 @@ # Your ZFS pool and datasets will be automatically imported # But we can specify mount points explicitly for clarity fileSystems = { - "/mnt/20tb/Movies" = { + "/mnt/ai" = { + device = "datapool/ai"; + fsType = "zfs"; + options = [ "defaults" ]; + }; + "/mnt/movies" = { device = "datapool/movies"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/TV_Shows" = { + "/mnt/tvshows" = { device = "datapool/tv_shows"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Music" = { + "/mnt/music" = { device = "datapool/music"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Astrophotography" = { + "/mnt/astrophotography" = { device = "datapool/astro"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Downloads" = { + "/mnt/downloads" = { device = "datapool/downloads"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Photos" = { + "/mnt/photos" = { device = "datapool/photos"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Stash" = { + "/mnt/stash" = { device = "datapool/stash"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/ISOs" = { + "/mnt/ISOs" = { device = "datapool/isos"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Audiobooks" = { + "/mnt/audiobooks" = { device = "datapool/audiobooks"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/VMs" = { + "/mnt/VMs" = { device = "datapool/vms"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Old_Backups" = { + "/mnt/old_backups" = { device = "datapool/old_backups"; fsType = "zfs"; options = [ "defaults" ]; }; - "/mnt/20tb/Services" = { + environment.etc."docker" = { device = "datapool/services"; fsType = "zfs"; options = [ "defaults" ]; @@ -101,56 +106,56 @@ script = '' # Set ownership and permissions for each dataset # Astrophotography - menno:menno 770 - zfs set acltype=posixacl datapool/astro - zfs set xattr=sa datapool/astro - chown menno:menno /mnt/20tb/Astrophotography - chmod 770 /mnt/20tb/Astrophotography + chown menno:menno /mnt/astrophotography + chmod 770 /mnt/astrophotography + + # docker - root:menno 775 + chown root:menno /mnt/docker + chmod 775 /mnt/docker + + # ai - menno:menno 770 + chown menno:menno /mnt/ai + chmod 770 /mnt/ai # Audiobooks - menno:users 760 - zfs set acltype=posixacl datapool/audiobooks - zfs set xattr=sa datapool/audiobooks - chown menno:users /mnt/20tb/Audiobooks - chmod 760 /mnt/20tb/Audiobooks + chown menno:users /mnt/audiobooks + chmod 760 /mnt/audiobooks # Downloads - menno:users 760 - chown menno:users /mnt/20tb/Downloads - chmod 760 /mnt/20tb/Downloads + chown menno:users /mnt/downloads + chmod 760 /mnt/downloads # ISOs - menno:libvirt 777 - chown menno:libvirt /mnt/20tb/ISOs - chmod 777 /mnt/20tb/ISOs + chown menno:libvirt /mnt/ISOs + chmod 777 /mnt/ISOs # VMs - menno:libvirt 777 - chown menno:libvirt /mnt/20tb/VMs - chmod 777 /mnt/20tb/VMs + chown menno:libvirt /mnt/VMs + chmod 777 /mnt/VMs # Movies - menno:users 760 - chown menno:users /mnt/20tb/Movies - chmod 760 /mnt/20tb/Movies + chown menno:users /mnt/movies + chmod 760 /mnt/movies # Music - menno:users 760 - chown menno:users /mnt/20tb/Music - chmod 760 /mnt/20tb/Music + chown menno:users /mnt/music + chmod 760 /mnt/music - # Old_Backups - menno:users 760 - chown menno:users /mnt/20tb/Old_Backups - chmod 760 /mnt/20tb/Old_Backups + # old_backups - menno:users 760 + chown menno:users /mnt/old_backups + chmod 760 /mnt/old_backups # Photos - menno:menno 775 - chown menno:menno /mnt/20tb/Photos - chmod 775 /mnt/20tb/Photos - - # Services - menno:users 760 - chown menno:users /mnt/20tb/Services - chmod 760 /mnt/20tb/Services + chown menno:menno /mnt/photos + chmod 775 /mnt/photos # Stash - menno:menno 775 - chown menno:menno /mnt/20tb/Stash - chmod 775 /mnt/20tb/Stash + chown menno:menno /mnt/stash + chmod 775 /mnt/stash # TV_Shows - menno:users 760 - chown menno:users /mnt/20tb/TV_Shows - chmod 760 /mnt/20tb/TV_Shows + chown menno:users /mnt/tvshows + chmod 760 /mnt/tvshows ''; serviceConfig = { Type = "oneshot"; @@ -165,8 +170,7 @@ set -euo pipefail DATE=$(date +%Y%m%d-%H%M) - # Updated DATASETS list to match your actual datasets - DATASETS="movies tv_shows music astro downloads photos stash isos audiobooks vms old_backups services" + DATASETS="music astro photos stash isos ai audiobooks vms old_backups services" RETAIN_SNAPSHOTS=24 BACKUP_POOL="backup" SOURCE_POOL="datapool"