From 687569a09f306215047e9ea91da1cfc54767e68a Mon Sep 17 00:00:00 2001 From: mc-fucker Date: Mon, 1 Aug 2022 15:26:50 +0200 Subject: [PATCH] changed invidious to standalone --- modules/invidious.nix | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) 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: