mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-24 03:44:52 +00:00
add arr services
This commit is contained in:
parent
2aea76c0e3
commit
86076f0844
@ -42,6 +42,7 @@ nixpkgs.lib.nixosSystem {
|
||||
streamServer = "stream.masu.rs";
|
||||
nextcloudServer = "cloud.masu.rs";
|
||||
bookServer = "books.masu.rs";
|
||||
arrServer = "download.masu.rs";
|
||||
samba.enable = true;
|
||||
|
||||
backup.s3 = {
|
||||
|
71
modules/nixos/services/arr.nix
Normal file
71
modules/nixos/services/arr.nix
Normal file
@ -0,0 +1,71 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
arrServer = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for arr services";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.arrServer != null) {
|
||||
|
||||
services.sonarr.enable = true;
|
||||
services.radarr.enable = true;
|
||||
services.bazarr.enable = true;
|
||||
services.prowlarr.enable = true;
|
||||
|
||||
# Requires updating the base_url config value in each service
|
||||
# If you try to rewrite the URL, the service won't redirect properly
|
||||
caddy.routes = [
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/sonarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:8989"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/radarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:7878"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/prowlarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:9696"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/bazarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:6767"; }];
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
{ ... }: {
|
||||
|
||||
imports = [
|
||||
./arr.nix
|
||||
./backups.nix
|
||||
./caddy.nix
|
||||
./calibre.nix
|
||||
|
@ -41,7 +41,9 @@
|
||||
};
|
||||
|
||||
# Create reverse proxy for web UI
|
||||
caddy.routes = [{
|
||||
caddy.routes = lib.mkAfter [{
|
||||
group =
|
||||
lib.mkIf (config.arrServer == config.transmissionServer) "download";
|
||||
match = [{ host = [ config.transmissionServer ]; }];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
|
Loading…
Reference in New Issue
Block a user