nix/container/Yt.nix

66 lines
1.5 KiB
Nix
Raw Normal View History

{
2024-11-04 04:37:29 +03:00
__findFile,
config,
container,
2024-11-15 01:42:21 +03:00
inputs,
2024-11-04 04:37:29 +03:00
lib,
pkgs,
2024-11-15 01:42:21 +03:00
pkgsMaster,
2024-11-04 04:37:29 +03:00
...
}: 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 {
2024-11-15 01:42:21 +03:00
disabledModules = [ "services/web-apps/invidious.nix" ];
imports = [ "${inputs.nixpkgsMaster}/nixos/modules/services/web-apps/invidious.nix" ];
2024-11-04 04:37:29 +03:00
services.invidious = {
2024-11-15 01:42:21 +03:00
enable = true;
domain = cfg.domain;
package = pkgsMaster.invidious;
port = cfg.port;
2024-11-04 04:37:29 +03:00
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
}