feat: Added jellyfin reverse proxy

This commit is contained in:
uttarayan21
2025-07-13 05:02:55 +05:30
parent fa718f5618
commit 71228dd717
19 changed files with 173 additions and 64 deletions

View File

@@ -20,6 +20,7 @@
propagation_timeout -1
propagation_delay 120s
dns hetzner {env.HETZNER_API_KEY}
resolvers 1.1.1.1
}
}
'';

View File

@@ -9,5 +9,6 @@
# ./radarr.nix
# ./prowlarr.nix
./deluge.nix
./homeassistant.nix
];
}

View File

@@ -0,0 +1,57 @@
{
pkgs,
lib,
...
}: {
virtualisation.docker.enable = true;
users.extraUsers.servius.extraGroups = ["docker"];
services.caddy = {
virtualHosts."home.darksailor.dev".extraConfig = ''
import hetzner
reverse_proxy localhost:8123
'';
};
# environment.systemPackages = [pkgs.arion pkgs.docker pkgs.podman];
# virtualisation.podman.enable = true;
# virtualisation.podman.dockerSocket.enable = true;
# # networking.firewall.allowedTCPPorts = [21063 21064];
# # networking.firewall.allowedUDPPorts = [5353];
#
# virtualisation.arion = {
# backend = "podman-socket";
# projects = {
# homeassistant.settings.services = {
# homeassistant = {
# service.image = "ghcr.io/home-assistant/home-assistant:stable";
# service.volumes = ["/etc/localtime:/etc/localtime:ro" "/run/dbus:/run/dbus:ro" "/var/lib/homeassistant:/config"];
# service.privileged = true;
# service.network_mode = "host";
# service.restart = "unless-stopped";
# };
# };
# };
# };
}
# {
# virtualisation.podman.enable = true;
# virtualisation.podman.dockerSocket.enable = true;
# users.extraUsers.servius.extraGroups = ["podman"];
# networking.firewall.enable = false;
# virtualisation.oci-containers = {
# backend = "podman";
# containers.homeassistant = {
# # environment.TZ = "Asia/Kolkata";
# # Note: The image will not be updated on rebuilds, unless the version label changes
# image = "ghcr.io/home-assistant/home-assistant:stable";
# volumes = ["/etc/localtime:/etc/localtime:ro" "/run/dbus:/run/dbus:ro" "/var/lib/homeassistant:/config"];
# extraOptions = [
# # Use the host network namespace for all sockets
# "--network=host"
# # Pass devices into the container, so Home Assistant can discover and make use of them
# "--device=/dev/ttyACM0:/dev/ttyACM0"
# ];
# };
# };
# }

View File

@@ -1,12 +1,12 @@
{...}: {
# services = {
# jellyseerr.enable = true;
# jellyfin.enable = true;
# caddy = {
# virtualHosts."jellyfin.tsuba.darksailor.dev".extraConfig = ''
# import hetzner
# reverse_proxy localhost:8096
# '';
# };
# };
services = {
jellyseerr.enable = true;
# jellyfin.enable = true;
caddy = {
virtualHosts."jellyfin.tsuba.darksailor.dev".extraConfig = ''
import hetzner
reverse_proxy localhost:8096
'';
};
};
}

View File

@@ -1,23 +1,44 @@
{
unstablePkgs,
config,
lib,
...
}: let
mkServarr = name: {
${name} = {
enable = true;
package = unstablePkgs.${name};
};
mkCaddy = name: {
caddy.virtualHosts."${name}.tsuba.darksailor.dev".extraConfig = ''
import hetzner
reverse_proxy localhost:${builtins.toString config.services.${name}.settings.server.port}
'';
};
in {
services =
mkServarr "radarr"
// mkServarr "sonarr"
// mkServarr "prowlarr";
# // mkServarr "readarr"
# // mkServarr "bazarr";
services = {
sonarr = {
enable = true;
package = unstablePkgs.sonarr;
group = "media";
};
radarr = {
enable = true;
package = unstablePkgs.radarr;
group = "media";
};
prowlarr = {
enable = true;
package = unstablePkgs.prowlarr;
};
caddy.virtualHosts = {
"sonarr.tsuba.darksailor.dev".extraConfig = ''
import hetzner
reverse_proxy localhost:${builtins.toString config.services.sonarr.settings.server.port}
'';
"radarr.tsuba.darksailor.dev".extraConfig = ''
import hetzner
reverse_proxy localhost:${builtins.toString config.services.radarr.settings.server.port}
'';
"prowlarr.tsuba.darksailor.dev".extraConfig = ''
import hetzner
reverse_proxy localhost:${builtins.toString config.services.prowlarr.settings.server.port}
'';
};
};
}