configuration.nix/hosts/layne/services/apps/bazarr.nix

33 lines
776 B
Nix
Raw Normal View History

2024-11-01 16:55:22 +05:30
{ 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" ];
2024-11-01 19:20:53 +05:30
unitConfig.RequiresMountsFor = [ "/mnt/data" ];
2024-11-01 16:55:22 +05:30
serviceConfig = {
Type = "simple";
User = user;
Group = group;
ExecStart = "${lib.getExe pkgs.bazarr} --port ${toString port} --config '${dataDir}'";
Restart = "on-failure";
};
};
}