config/profiles/web/services/invidious.nix

43 lines
1.3 KiB
Nix

{ config, pkgs, lib, inputs, mkDomain, ... }:
{
# Invidious
# An open source alternative front-end to YouTube
/** /
disabledModules = [ "services/web-apps/invidious.nix" ];
#imports = [ <nixos-unstable/nixos/modules/services/web-apps/invidious.nix> ];
imports = [ ("${inputs.unstable}/nixos/modules/services/web-apps/invidious.nix") ];
services.invidious.package = pkgs.unstable.invidious;
/**/
services.invidious = {
enable = true;
domain = mkDomain "invidious";
port = 4765;
settings = {
host_binding = "127.0.0.1";
external_port = 443;
https_only = true;
statistics_enabled = false; # api endpoint required for public instances
registration_enabled = false;
login_enabled = false;
#admins = ["pbsds"];
banner = "spis meg";
default_user_preferences = {
#feed_menu = ["Popular", "Trending", "Subscriptions", "Playlists"]
feed_menu = ["Trending" "Subscriptions" "Playlists"];
default_home = "Trending";
};
};
};
services.nginx.virtualHosts.${mkDomain "invidious"} = lib.mkIf config.services.invidious.enable {
forceSSL = true; # addSSL = true;
enableACME = true; #useACMEHost = acmeDomain;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.invidious.port}";
proxyWebsockets = true;
};
};
}