about summary refs log tree commit diff
path: root/modules/services/invidious.nix
blob: 17fec9f618c70d9d3d1fa6356bb1113da8b6bd10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
      };
    };
  };
}