diff options
Diffstat (limited to '')
-rw-r--r-- | hosts/by-name/server2/configuration.nix | 8 | ||||
-rw-r--r-- | modules/by-name/in/invidious-router/module.nix | 70 | ||||
-rw-r--r-- | system/services/default.nix | 1 | ||||
-rw-r--r-- | system/services/invidious-router/default.nix | 51 |
4 files changed, 78 insertions, 52 deletions
diff --git a/hosts/by-name/server2/configuration.nix b/hosts/by-name/server2/configuration.nix index abb29d7..5d3c7fb 100644 --- a/hosts/by-name/server2/configuration.nix +++ b/hosts/by-name/server2/configuration.nix @@ -27,6 +27,14 @@ domain = "git.foss-syndicate.org"; gitolite.adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz cardno:000F_18F83532"; }; + invidious-router = { + enable = true; + domain = "invidious-router.vhack.eu"; + extraDomains = [ + "video.fosswelt.org" + "invidious-router.sils.li" + ]; + }; nginx = { enable = true; redirects = { diff --git a/modules/by-name/in/invidious-router/module.nix b/modules/by-name/in/invidious-router/module.nix new file mode 100644 index 0000000..f85a06c --- /dev/null +++ b/modules/by-name/in/invidious-router/module.nix @@ -0,0 +1,70 @@ +{ + config, + lib, + pkgsUnstable, + ... +}: let + cfg = config.vhack.invidious-router; +in { + options.vhack.invidious-router = { + enable = lib.mkEnableOption "invidious-router"; + domain = lib.mkOption { + type = lib.types.str; + description = "The domain invidious-router should be served on"; + }; + extraDomains = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = []; + description = "Addtional domains invidious-router should be served on"; + }; + }; + config = lib.mkIf cfg.enable { + services.invidious-router = { + enable = true; + package = pkgsUnstable.invidious-router; + settings = { + app = { + listen = "127.0.0.1:8050"; + enable_youtube_fallback = false; + reload_instance_list_interval = "60s"; + not_available_message = '' + No available invidious instance found! + [link]View this video on YouTube[/link], a proprietary + platform that collects and uses your data without respecting + your privacy. + ''; + }; + api = { + enabled = true; + url = "https://api.invidious.io/instances.json"; + filter_regions = false; + allowed_regions = [ + "AT" + "DE" + "CH" + ]; + }; + healthcheck = { + path = "/watch?v=uSvJaYxRoB4"; + allowed_status_codes = [ + 200 + ]; + timeout = "1s"; + interval = "10s"; + filter_by_response_time = { + enabled = true; + qty_of_top_results = 4; + }; + minimum_ratio = 0.2; + remove_no_ratio = false; + text_not_present = "YouTube is currently trying to block Invidious instances"; + }; + }; + nginx = { + enable = true; + inherit (cfg) domain extraDomains; + }; + }; + vhack.nginx.enable = true; + }; +} diff --git a/system/services/default.nix b/system/services/default.nix index 7d2b4d2..3403eea 100644 --- a/system/services/default.nix +++ b/system/services/default.nix @@ -1,7 +1,6 @@ {...}: { imports = [ ./invidious - ./invidious-router ./mail ./mastodon ./matrix diff --git a/system/services/invidious-router/default.nix b/system/services/invidious-router/default.nix deleted file mode 100644 index 8829d3b..0000000 --- a/system/services/invidious-router/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{pkgsUnstable, ...}: { - services.invidious-router = { - enable = true; - package = pkgsUnstable.invidious-router; - settings = { - app = { - listen = "127.0.0.1:8050"; - enable_youtube_fallback = false; - reload_instance_list_interval = "60s"; - not_available_message = '' - No available invidious instance found! - [link]View this video on YouTube[/link], a proprietary - platform that collects and uses your data without respecting - your privacy. - ''; - }; - api = { - enabled = true; - url = "https://api.invidious.io/instances.json"; - filter_regions = false; - allowed_regions = [ - "AT" - "DE" - "CH" - ]; - }; - healthcheck = { - path = "/watch?v=uSvJaYxRoB4"; - allowed_status_codes = [ - 200 - ]; - timeout = "1s"; - interval = "10s"; - filter_by_response_time = { - enabled = true; - qty_of_top_results = 4; - }; - minimum_ratio = 0.2; - remove_no_ratio = false; - text_not_present = "YouTube is currently trying to block Invidious instances"; - }; - }; - nginx = { - enable = true; - domain = "invidious-router.sils.li"; - extraDomains = [ - "video.fosswelt.org" - ]; - }; - }; -} |