summaryrefslogtreecommitdiff
path: root/adonis/tor/default.nix
blob: 7fcf2b48d2f8c20e07763c8ed65a72696bcbe280 (plain) (blame)
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
{config, ...}: let
  owner = config.customOps.owner.username;
  domain = config.customOps.domain.fqdn;
in {
  imports = [./snowflake.nix];

  services.tor = {
    enable = true;
    openFirewall = true;
    enableGeoIP = false;
    torsocks.enable = true;
    client.enable = true;

    relay = {
      enable = true;
      role = "relay";
    };

    settings = {
      Nickname = "${owner}";
      ContactInfo = "admin.tor@${domain}";

      ExitRelay = false;

      MaxAdvertisedBandwidth = "100 MB";
      BandWidthRate = "100 MB";
      RelayBandwidthRate = "100 MB";
      RelayBandwidthBurst = "100 MB";

      CookieAuthentication = true;
      AvoidDiskWrites = 1;
      HardwareAccel = 0;
      SafeLogging = 1;
      NumCPUs = 4;

      ORPort = [
        9001
        {
          addr = "[2a0a:4cc0:c1:cf00::10]";
          port = 9030;
        }
      ];
    };
  };
}