nix/container/Yt.nix

65 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{
container,
pkgs,
lib,
config,
__findFile,
...
}:
with lib;
let
cfg = config.container.module.yt;
in
{
options = {
container.module.yt = {
enable = mkEnableOption "YouTube frontend.";
address = mkOption {
default = "10.1.0.19";
type = types.str;
};
port = mkOption {
default = 3000;
type = types.int;
};
domain = mkOption {
default = "yt.${config.container.domain}";
type = types.str;
};
storage = mkOption {
default = "${config.container.storage}/yt";
type = types.str;
};
};
};
2024-06-25 04:04:39 +03:00
config = mkIf cfg.enable {
containers.yt = container.mkContainer cfg {
config =
{ ... }:
container.mkContainerConfig cfg {
services.invidious = {
enable = true;
domain = cfg.domain;
port = cfg.port;
nginx.enable = false;
database = {
port = config.container.module.postgres.port;
host = config.container.module.postgres.address;
createLocally = false;
passwordFile = "${pkgs.writeText "InvidiousDbPassword" "invidious"}";
};
settings = {
admins = [ "root" ];
captcha_enabled = false;
check_tables = true;
registration_enabled = false;
external_port = 443;
https_only = true;
};
};
};
};
};
2024-06-09 23:35:53 +03:00
}