configuration.nix/hosts/layne/services/apps/bazarr.nix
2024-11-17 14:06:46 +05:30

32 lines
776 B
Nix

{ pkgs, lib, ... }:
let
user = "mediaserver";
group = "mediaserver";
dataDir = "/mnt/data/bazarr";
port = 6767;
in
{
services.caddy.virtualHosts."bazarr.labs.adtya.xyz" = {
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" ];
unitConfig.RequiresMountsFor = [ "/mnt/data" ];
serviceConfig = {
Type = "simple";
User = user;
Group = group;
ExecStart = "${lib.getExe pkgs.bazarr} --port ${toString port} --config '${dataDir}'";
Restart = "on-failure";
};
};
}