From b12eca9efcb6f1df19b7e78d7c73179f351ac061 Mon Sep 17 00:00:00 2001 From: sefidel Date: Sat, 3 Feb 2024 19:00:28 +0900 Subject: feat(modules): add invidious --- modules/services/invidious.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 modules/services/invidious.nix diff --git a/modules/services/invidious.nix b/modules/services/invidious.nix new file mode 100644 index 0000000..17fec9f --- /dev/null +++ b/modules/services/invidious.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.services.invidious; +in +{ + options.modules.services.invidious = { + enable = mkEnableOption "invidious instance"; + + domain = mkOption { type = types.str; }; + realHost = mkOption { type = types.str; default = "invidious.${cfg.domain}"; }; + secrets = { + invidious-hmac-key = mkOption { type = types.path; description = "path to the file containing the HMAC key"; }; + }; + }; + + config = mkIf cfg.enable { + services.invidious = { + enable = true; + + port = 4003; + domain = cfg.realHost; + + hmacKeyFile = cfg.secrets.invidious-hmac-key; + + settings = { + db.user = "indivious"; + captions = [ "English" "Japanese" "Korean" ]; + check_tables = true; + }; + }; + }; +} -- cgit 1.4.1