diff options
| author | Max Audron <audron@cocaine.farm> | 2024-02-07 14:46:29 +0000 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2024-02-07 17:27:40 +0000 |
| commit | 44ee565dfcf908df660751351d00caeb2ba39bc8 (patch) | |
| tree | 43a11284abc04d0657901f56e579dd86166814da /modules/tlmp/default.nix | |
| parent | update authentik (diff) | |
migrate tlmp setup to nixos
Diffstat (limited to '')
| -rw-r--r-- | modules/tlmp/default.nix | 80 |
1 files changed, 57 insertions, 23 deletions
diff --git a/modules/tlmp/default.nix b/modules/tlmp/default.nix index e653b29..e9f286f 100644 --- a/modules/tlmp/default.nix +++ b/modules/tlmp/default.nix @@ -2,7 +2,7 @@ with self.lib.nginx; { - imports = [ ./rutorrent.nix ]; + imports = [ ./rutorrent.nix ./rtorrent.nix ]; security.acme.certs = { "media.cocaine.farm" = { @@ -10,7 +10,37 @@ with self.lib.nginx; }; }; - services.jellyfin.enable = true; + users = { + users.media = { + isSystemUser = true; + group = "media"; + }; + groups.media = {}; + }; + + services.jellyfin = { + enable = true; + user = "media"; + group = "media"; + }; + + services.radarr = { + enable = true; + user = "media"; + group = "media"; + }; + + services.sonarr = { + enable = true; + package = pkgs.callPackage ./sonarr.nix {}; + user = "media"; + group = "media"; + }; + + services.prowlarr = { + enable = true; + }; + services.jackett = let jackett = pkgs.jackett.overrideAttrs (prev: { doCheck = false; @@ -24,43 +54,47 @@ with self.lib.nginx; services.rutorrent = { enable = true; hostName = "torrent.media.cocaine.farm"; - rpcSocket = "10.101.131.197"; plugins = lib.mkForce [ "data" "diskspace" "edit" "erasedata" "theme" "trafic" ]; nginx.enable = true; }; + virtualisation.oci-containers.containers = { + flaresolverr = { + image = "ghcr.io/flaresolverr/flaresolverr:v3.3.13"; + autoStart = true; + ports = [ + "10.10.0.2:8191:8191" + ]; + }; + }; + services.nginx = { enable = true; virtualHosts = { "media.cocaine.farm" = (proxyDomain "media.cocaine.farm" "http://127.0.0.1:8096/"); - "sonarr.media.cocaine.farm" = proxyDomainAuth "media.cocaine.farm" "http://10.101.73.6:80"; - "radarr.media.cocaine.farm" = proxyDomainAuth "media.cocaine.farm" "http://10.101.22.234:80"; + "sonarr.media.cocaine.farm" = proxyDomainAuth "media.cocaine.farm" "http://127.0.0.1:8989"; + "radarr.media.cocaine.farm" = proxyDomainAuth "media.cocaine.farm" "http://127.0.0.1:7878"; + "prowlarr.media.cocaine.farm" = proxyDomainAuth "media.cocaine.farm" "http://127.0.0.1:9696"; "jackett.media.cocaine.farm" = proxyDomainAuth "media.cocaine.farm" "http://127.0.0.1:9117"; - "torrent.media.cocaine.farm" = { - addSSL = true; - useACMEHost = "media.cocaine.farm"; + "torrent.media.cocaine.farm" = domainAuth "media.cocaine.farm"; + + "torrent.local" = { + listen = [{ + addr = "10.10.0.2"; + port = 80; + }]; locations."/RPC2" = { extraConfig = '' include ${pkgs.nginx}/conf/scgi_params; - scgi_pass 10.101.131.197:5000; + scgi_pass unix:/run/rtorrent/rpc.sock; ''; }; - - - # locations."/" = { - # proxyPass = "http://127.0.0.1"; - # proxyWebsockets = true; - # extraConfig = '' - # proxy_pass_header Authorization; - - # proxy_set_header X-Forwarded-Proto $scheme; - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header Host $host; - # proxy_set_header Upgrade $http_upgrade; - # ''; - # }; }; }; }; + + networking.hosts = { + "10.10.0.2" = [ "torrent.local" ]; + }; } |
