37 lines
708 B
Nix
37 lines
708 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.services.invidious;
|
|
fqdn = "${cfg.subdomain}.${config.networking.domain}";
|
|
in
|
|
{
|
|
options.services.invidious = {
|
|
subdomain = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services = {
|
|
invidious = {
|
|
domain = fqdn;
|
|
address = "127.0.0.1";
|
|
|
|
settings = {
|
|
external_port = 443;
|
|
db = {
|
|
dbname = "invidious";
|
|
user = "invidious";
|
|
};
|
|
};
|
|
};
|
|
|
|
postgresql.enable = lib.mkDefault true;
|
|
|
|
webserver = {
|
|
enable = lib.mkDefault true;
|
|
vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
|
|
};
|
|
};
|
|
};
|
|
}
|