Files
nixos/modules/services/invidious.nix
Joakim Repomaa c519f8d83e refactor
2025-02-12 23:54:07 +02:00

35 lines
679 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";
};
};
};
services.postgresql.enable = lib.mkDefault true;
services.webserver = {
enable = lib.mkDefault true;
vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
};
};
}