nix/container/Yt.nix

60 lines
1.3 KiB
Nix
Raw Normal View History

{
2024-11-04 04:37:29 +03:00
__findFile,
config,
container,
lib,
pkgs,
...
}: let
cfg = config.container.module.yt;
in {
options.container.module.yt = {
enable = lib.mkEnableOption "the YouTube frontend.";
address = lib.mkOption {
default = "10.1.0.19";
type = lib.types.str;
};
port = lib.mkOption {
default = 3000;
type = lib.types.int;
};
domain = lib.mkOption {
default = "yt.${config.container.domain}";
type = lib.types.str;
};
storage = lib.mkOption {
default = "${config.container.storage}/yt";
type = lib.types.str;
};
};
2024-06-25 04:04:39 +03:00
2024-11-04 04:37:29 +03:00
config = lib.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 = {
host = config.container.module.postgres.address;
port = config.container.module.postgres.port;
createLocally = false;
passwordFile = "${pkgs.writeText "InvidiousDbPassword" "invidious"}";
};
settings = {
captcha_enabled = false;
check_tables = true;
external_port = 443;
https_only = true;
registration_enabled = false;
admins = [
"root"
];
};
};
};
};
};
2024-06-09 23:35:53 +03:00
}