about summary refs log tree commit diff
path: root/modules/services/nitter/default.nix
blob: 40e8be860af1109c357ae8b831e6e632ba64e95b (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
35
36
37
38
39
{ config, lib, pkgs, ... }:

with lib;
let
  cfg = config.modules.services.nitter;
in
{
  options.modules.services.nitter = {
    enable = mkEnableOption "nitter instance";

    title = mkOption { type = types.str; default = "Nitter"; description = "Title of the nitter instance"; };

    domain = mkOption { type = types.str; };
    realHost = mkOption { type = types.str; default = "nitter.${cfg.domain}"; };
    secrets = {
      nitter-guest-accounts = mkOption { type = types.path; description = "path to the JSONL file containing guest accounts"; };
    };
  };

  config = mkIf cfg.enable {
    services.nitter = {
      enable = true;

      package = pkgs.nitter.overrideAttrs {
        patches = [
          ./0001-HACK-allow-non-guest-account.patch
        ];
      };

      server = {
        title = cfg.title;
        address = "127.0.0.1";
        port = 4002;
        hostname = cfg.realHost;
      };
      guestAccounts = cfg.secrets.nitter-guest-accounts;
    };
  };
}