2024-08-28 01:31:17 +03:00
|
|
|
{ container, pkgs, lib, config, __findFile, ... }: with lib; let
|
2024-06-25 04:04:39 +03:00
|
|
|
cfg = config.container.module.yt;
|
2024-06-09 23:35:53 +03:00
|
|
|
in {
|
2024-06-25 04:04:39 +03:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|