mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(mediabox): library mounts
This commit is contained in:
parent
228e2cf788
commit
59c61d021e
20 changed files with 416 additions and 101 deletions
38
nixos/access/bazarr.nix
Normal file
38
nixos/access/bazarr.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkDefault mkOptionDefault;
|
||||
cfg = config.services.bazarr;
|
||||
access = config.services.nginx.access.bazarr;
|
||||
proxyPass = mkDefault "https://${access.host}:${toString access.port}";
|
||||
locations = {
|
||||
"/" = {
|
||||
inherit proxyPass;
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.services.nginx.access.bazarr = with lib.types; {
|
||||
host = mkOption {
|
||||
type = str;
|
||||
};
|
||||
domain = mkOption {
|
||||
type = str;
|
||||
default = "bazarr.${config.networking.domain}";
|
||||
};
|
||||
port = mkOption {
|
||||
type = port;
|
||||
};
|
||||
};
|
||||
config.services.nginx = {
|
||||
access.bazarr = mkIf cfg.enable {
|
||||
host = mkOptionDefault "localhost";
|
||||
port = mkOptionDefault cfg.listenPort;
|
||||
};
|
||||
virtualHosts = {
|
||||
${access.domain} = {
|
||||
inherit locations;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue