summaryrefslogtreecommitdiff
path: root/hostnix/elmo/privacy-frontends.nix
blob: ad90c325003104a419a7154cffdfb90a15c7615d (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ pkgs, ... }:

{
  services.redlib = {
    enable = true;
    address = "[::1]";
    port = 7682;
  };

  systemd.services.redlib = {
    environment = {
      REDLIB_DEFAULT_SHOW_NSFW = "on";
      REDLIB_DEFAULT_USE_HLS = "on";
      REDLIB_DEFAULT_WIDE = "on";
      REDLIB_ROBOTS_DISABLE_INDEXING = "on";
    };
  };

  services.nginx.virtualHosts."lr.mou.fo" = {
    enableACME = true;
    forceSSL = true;
    locations."/".proxyPass = "http://[::1]:7682";
  };

  systemd.tmpfiles.rules = [
    "d /var/secrets/nitter 0750 root wheel"
  ];

  services.nitter = {
    enable = true;
    # This must be populated manually as per
    # https://github.com/zedeus/nitter/wiki/Guest-Account-Branch-Deployment
    # Alternatively it can use logged in account tokens with
    # https://github.com/PrivacyDevel/nitter/blob/master/twitter_oauth.sh
    guestAccounts = "/var/secrets/nitter/guest-accounts.jsonl";
    server = {
      port = 7873;
      https = true;
      hostname = "ni.mou.fo";
      address = "127.0.0.1";
    };
    preferences = {
      hlsPlayback = true;
    };
  };

  systemd.services.nitter = {
    unitConfig = {
      AssertPathExists = "/var/secrets/nitter/guest-accounts.jsonl";
    };
  };

  services.nginx.virtualHosts."ni.mou.fo" = {
    enableACME = true;
    forceSSL = true;
    locations."/".proxyPass = "http://127.0.0.1:7873";
  };
}