diff --git a/modules/invidious.nix b/modules/invidious.nix index 099f479..eae77fd 100644 --- a/modules/invidious.nix +++ b/modules/invidious.nix @@ -1,11 +1,15 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: +let + iv_port = "3001"; + domain = "yt.mc-fucker.cool"; +in { services.invidious = { #package = pkgs.callPackage /root/invidious { # lsquic = pkgs.callPackage /root/invidious/lsquic.nix {}; #}; enable = true; - port = 3001; + port = (lib.strings.toInt iv_port); database = { createLocally = false; host = "postgres"; @@ -24,6 +28,26 @@ Restart = "always"; RestartSec = "2s"; }; + + services.nginx.virtualHosts."${domain}" = { + forceSSL = true; + enableACME = true; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:${iv_port}"; + extraConfig = '' + set $empty ""; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_http_version 1.1; + proxy_set_header Connection ""; + ''; + }; + + }; + + }; + } # vim: set et ts=2 sw=2 ai: