From bc954cc68da67a578fb9845a611f981f6ccc8fab Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 18 May 2023 16:58:36 +0200 Subject: [PATCH] refactored *arr --- nixos/hosts/hades/default.nix | 22 +++----------- nixos/hosts/hades/overseerr/README.md | 2 ++ nixos/hosts/hades/overseerr/configuration.nix | 29 +++++-------------- nixos/hosts/hades/overseerr/overseerr.nix | 10 +++++++ nixos/hosts/hades/overseerr/prowlarr.nix | 11 +++++++ nixos/hosts/hades/overseerr/radarr.nix | 7 +++++ nixos/hosts/hades/overseerr/sonarr.nix | 7 +++++ .../unpackerr.nix} | 16 ++-------- nixos/hosts/hades/prowlarr/configuration.nix | 21 -------------- nixos/hosts/hades/radarr/configuration.nix | 15 ---------- nixos/hosts/hades/sonarr/configuration.nix | 15 ---------- 11 files changed, 51 insertions(+), 104 deletions(-) create mode 100644 nixos/hosts/hades/overseerr/README.md create mode 100644 nixos/hosts/hades/overseerr/overseerr.nix create mode 100644 nixos/hosts/hades/overseerr/prowlarr.nix create mode 100644 nixos/hosts/hades/overseerr/radarr.nix create mode 100644 nixos/hosts/hades/overseerr/sonarr.nix rename nixos/hosts/hades/{unpackerr/configuration.nix => overseerr/unpackerr.nix} (56%) delete mode 100644 nixos/hosts/hades/prowlarr/configuration.nix delete mode 100644 nixos/hosts/hades/radarr/configuration.nix delete mode 100644 nixos/hosts/hades/sonarr/configuration.nix diff --git a/nixos/hosts/hades/default.nix b/nixos/hosts/hades/default.nix index e7e6377..b6af2da 100644 --- a/nixos/hosts/hades/default.nix +++ b/nixos/hosts/hades/default.nix @@ -84,10 +84,7 @@ mac = "00:50:56:91:0d:69"; nix = false; }; - "unpackerr" = { - ip = "192.168.0.116"; - mac = "06:8a:8e:3e:43:45"; - }; + # ip = "192.168.0.116"; "thelounge" = { ip = "192.168.0.117"; mac = "00:0c:29:2a:69:8f"; @@ -102,11 +99,7 @@ ip = "192.168.0.119"; mac = "DE:7C:32:7E:DD:A1"; }; - "radarr2" = { - ip = "192.168.0.120"; - mac = "5e:d3:75:93:56:ee"; - profile = "radarr"; - }; + # ip = "192.168.0.120"; "jackett2" = { ip = "192.168.0.121"; mac = "4e:e7:64:b7:88:b8"; @@ -159,19 +152,12 @@ mac = "00:0c:29:9b:e1:c4"; nix = false; }; - "sonarr2" = { - ip = "192.168.0.132"; - mac = "ea:ac:be:53:18:27"; - profile = "sonarr"; - }; + # ip = "192.168.0.132"; "mastodon" = { ip = "192.168.0.138"; mac = "52:60:8a:06:86:9c"; }; - "prowlarr" = { - ip = "192.168.0.140"; - mac = "3a:67:8e:98:0c:a2"; - }; + # ip = "192.168.0.140"; "archlinux" = { ip = "192.168.0.200"; mac = "00:0c:29:e4:0d:17"; diff --git a/nixos/hosts/hades/overseerr/README.md b/nixos/hosts/hades/overseerr/README.md new file mode 100644 index 0000000..dfaa561 --- /dev/null +++ b/nixos/hosts/hades/overseerr/README.md @@ -0,0 +1,2 @@ +# Overseerr & co. +This LXC container hosts all my *arr services and overseerr diff --git a/nixos/hosts/hades/overseerr/configuration.nix b/nixos/hosts/hades/overseerr/configuration.nix index 36911a9..86fe297 100644 --- a/nixos/hosts/hades/overseerr/configuration.nix +++ b/nixos/hosts/hades/overseerr/configuration.nix @@ -2,11 +2,14 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ ... }: - -{ +{ ... }: { imports = [ + ./radarr.nix + ./sonarr.nix ./lidarr.nix + ./prowlarr.nix + ./unpackerr.nix + ./overseerr.nix ]; # This value determines the NixOS release from which the default @@ -17,29 +20,11 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "22.11"; # Did you read the comment? - # Additional packages - # environment.systemPackages = with pkgs; [ ]; - - networking.firewall.allowedTCPPorts = [ 5055 ]; - fileSystems."/mnt/storage" = { device = "storage:/mnt/storage"; fsType = "nfs"; }; virtualisation.podman.enable = true; - # TODO: Write NixOS package https://github.com/NixOS/nixpkgs/issues/135885 - virtualisation.oci-containers = { - backend = "podman"; - containers = { - overseerr = { - image = "ghcr.io/sct/overseerr:1.32.5"; - environment = { - TZ = "Europe/Amsterdam"; - }; - ports = [ "5055:5055" ]; - volumes = [ "/var/lib/overseerr/config:/app/config" ]; - }; - }; - }; + virtualisation.oci-containers.backend = "podman"; } diff --git a/nixos/hosts/hades/overseerr/overseerr.nix b/nixos/hosts/hades/overseerr/overseerr.nix new file mode 100644 index 0000000..a254dcf --- /dev/null +++ b/nixos/hosts/hades/overseerr/overseerr.nix @@ -0,0 +1,10 @@ +{ ... }: { + networking.firewall.allowedTCPPorts = [ 5055 ]; + # TODO: Write NixOS package https://github.com/NixOS/nixpkgs/issues/135885 + virtualisation.oci-containers.containers.overseerr = { + image = "ghcr.io/sct/overseerr:1.32.5"; + environment = { TZ = "Europe/Amsterdam"; }; + ports = [ "5055:5055" ]; + volumes = [ "/var/lib/overseerr/config:/app/config" ]; + }; +} diff --git a/nixos/hosts/hades/overseerr/prowlarr.nix b/nixos/hosts/hades/overseerr/prowlarr.nix new file mode 100644 index 0000000..8c2b7f9 --- /dev/null +++ b/nixos/hosts/hades/overseerr/prowlarr.nix @@ -0,0 +1,11 @@ +{ ... }: { + services.prowlarr = { + enable = true; + openFirewall = true; + }; + + virtualisation.oci-containers.containers.flaresolverr = { + image = "flaresolverr/flaresolverr:v3.1.2"; + ports = [ "8191:8191" ]; + }; +} diff --git a/nixos/hosts/hades/overseerr/radarr.nix b/nixos/hosts/hades/overseerr/radarr.nix new file mode 100644 index 0000000..f1a10b5 --- /dev/null +++ b/nixos/hosts/hades/overseerr/radarr.nix @@ -0,0 +1,7 @@ +{ ... }: { + services.radarr = { + enable = true; + openFirewall = true; + dataDir = "/var/lib/radarr"; + }; +} diff --git a/nixos/hosts/hades/overseerr/sonarr.nix b/nixos/hosts/hades/overseerr/sonarr.nix new file mode 100644 index 0000000..1bc05bf --- /dev/null +++ b/nixos/hosts/hades/overseerr/sonarr.nix @@ -0,0 +1,7 @@ +{ ... }: { + services.sonarr = { + enable = true; + dataDir = "/var/lib/sonarr"; + openFirewall = true; + }; +} diff --git a/nixos/hosts/hades/unpackerr/configuration.nix b/nixos/hosts/hades/overseerr/unpackerr.nix similarity index 56% rename from nixos/hosts/hades/unpackerr/configuration.nix rename to nixos/hosts/hades/overseerr/unpackerr.nix index a57ca6a..b04f474 100644 --- a/nixos/hosts/hades/unpackerr/configuration.nix +++ b/nixos/hosts/hades/overseerr/unpackerr.nix @@ -1,29 +1,19 @@ { config, ... }: let vs = config.vault-secrets.secrets; in { - networking.interfaces.eth0.useDHCP = true; - - fileSystems."/mnt/storage" = { - device = "storage:/mnt/storage"; - fsType = "nfs"; - }; - - system.stateVersion = "21.11"; - vault-secrets.secrets.unpackerr = { }; services.unpackerr = { enable = true; - debug = true; + debug = false; environmentFile = "${vs.unpackerr}/environment"; sonarr = { - url = "http://sonarr2:8989/"; + url = "http://localhost:8989/"; paths = "/mnt/storage/torrents/r/TV"; }; radarr = { - url = "http://radarr2:7878/"; + url = "http://localhost:7878/"; paths = "/mnt/storage/torrents/r/Movie"; }; }; } - diff --git a/nixos/hosts/hades/prowlarr/configuration.nix b/nixos/hosts/hades/prowlarr/configuration.nix deleted file mode 100644 index d0ecc2f..0000000 --- a/nixos/hosts/hades/prowlarr/configuration.nix +++ /dev/null @@ -1,21 +0,0 @@ -_: { - networking.interfaces.eth0.useDHCP = true; - system.stateVersion = "22.11"; - - services.prowlarr = { - enable = true; - openFirewall = true; - }; - - virtualisation.podman.enable = true; - - virtualisation.oci-containers = { - backend = "podman"; - containers = { - flaresolverr = { - image = "flaresolverr/flaresolverr:v3.1.2"; - ports = [ "8191:8191" ]; - }; - }; - }; -} diff --git a/nixos/hosts/hades/radarr/configuration.nix b/nixos/hosts/hades/radarr/configuration.nix deleted file mode 100644 index 5a3b874..0000000 --- a/nixos/hosts/hades/radarr/configuration.nix +++ /dev/null @@ -1,15 +0,0 @@ -_: { - system.stateVersion = "21.05"; - networking.interfaces.eth0.useDHCP = true; - - fileSystems."/mnt/storage" = { - device = "storage:/mnt/storage"; - fsType = "nfs"; - }; - - services.radarr = { - enable = true; - dataDir = "/data/radarr"; - openFirewall = true; - }; -} diff --git a/nixos/hosts/hades/sonarr/configuration.nix b/nixos/hosts/hades/sonarr/configuration.nix deleted file mode 100644 index 5137cc1..0000000 --- a/nixos/hosts/hades/sonarr/configuration.nix +++ /dev/null @@ -1,15 +0,0 @@ -_: { - system.stateVersion = "21.05"; - networking.interfaces.eth0.useDHCP = true; - - fileSystems."/mnt/storage" = { - device = "storage:/mnt/storage"; - fsType = "nfs"; - }; - - services.sonarr = { - enable = true; - dataDir = "/data/sonarr"; - openFirewall = true; - }; -}