aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/tor/default.nix
blob: a2af4aa8fa28e8048434aa6421841801624987b8 (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
{
  pkgs,
  lib,
  config,
  ...
}:

# Tor - Local proxy server for connecting to the tor network
{
  options.tools.tor = {
    enable = lib.mkEnableOption "Enables tor.";
  };

  config = lib.mkIf config.tools.tor.enable {
    home.packages = with pkgs; [
      tor
    ];

    home.file.".config/tor/torrc".text = ''
      SocksPort 127.0.0.1:9050
      CookieAuthentication 1
      # Prevents Tor from writing to disk too much
      AvoidDiskWrites 1
    '';
  };
}