From 3f0820e577e08be1b78e0b79b3cc3c20c9588fd0 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Fri, 1 Nov 2024 16:55:22 +0530 Subject: [PATCH] layne: setup bazarr --- hosts/layne/services/apps/bazarr.nix | 34 +++++++++++++++++++++++++++ hosts/layne/services/apps/default.nix | 1 + hosts/shared/blocky.nix | 1 + 3 files changed, 36 insertions(+) create mode 100644 hosts/layne/services/apps/bazarr.nix diff --git a/hosts/layne/services/apps/bazarr.nix b/hosts/layne/services/apps/bazarr.nix new file mode 100644 index 0000000..0c9f434 --- /dev/null +++ b/hosts/layne/services/apps/bazarr.nix @@ -0,0 +1,34 @@ +{ pkgs, lib, ... }: +let + inherit (import ../../../shared/caddy-helpers.nix) logFormat; + user = "mediaserver"; + group = "mediaserver"; + dataDir = "/mnt/data/bazarr"; + port = 6767; +in +{ + services.caddy.virtualHosts."bazarr.labs.adtya.xyz" = { + inherit logFormat; + extraConfig = '' + reverse_proxy 127.0.0.1:${toString port} + ''; + }; + systemd.tmpfiles.settings."10-bazarr".${dataDir}.d = { + inherit user group; + mode = "0700"; + }; + + systemd.services.bazarr = { + description = "Bazarr"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "simple"; + User = user; + Group = group; + ExecStart = "${lib.getExe pkgs.bazarr} --port ${toString port} --config '${dataDir}'"; + Restart = "on-failure"; + }; + }; +} diff --git a/hosts/layne/services/apps/default.nix b/hosts/layne/services/apps/default.nix index 6507d62..3215b32 100644 --- a/hosts/layne/services/apps/default.nix +++ b/hosts/layne/services/apps/default.nix @@ -6,6 +6,7 @@ _: { ./sonarr.nix ./readarr.nix ./prowlarr.nix + ./bazarr.nix ../../../shared/prometheus-exporters.nix ../../../shared/promtail.nix ]; diff --git a/hosts/shared/blocky.nix b/hosts/shared/blocky.nix index 22ebd00..d825fe8 100644 --- a/hosts/shared/blocky.nix +++ b/hosts/shared/blocky.nix @@ -67,6 +67,7 @@ # Services "alertmanager.labs.adtya.xyz" = "10.10.10.12"; "act-cache.labs.adtya.xyz" = "10.10.10.13"; + "bazarr.labs.adtya.xyz" = "10.10.10.14"; "blocky.rico1.labs.adtya.xyz" = "10.10.10.11"; "blocky.rico2.labs.adtya.xyz" = "10.10.10.12"; "grafana.labs.adtya.xyz" = "10.10.10.12";