nixos/modules/tor/default.nix
Casper V. Kristensen c9b26002c0 tor cleanup
2023-08-11 17:43:23 +02:00

33 lines
757 B
Nix

{ config, pkgs, ... }: {
services.tor = {
enable = true;
openFirewall = true;
relay = {
enable = true;
role = "exit";
};
settings = {
ContactInfo = "admin@caspervk.net";
ControlPort = 9051; # for nyx
DirPort = 80;
DirPortFrontPage = builtins.toFile "tor-exit-notice.html" (builtins.readFile ./tor-exit-notice.html);
ExitRelay = true;
IPv6Exit = true;
ExitPolicy = [
"reject *:25"
"accept *:*"
];
};
};
environment.systemPackages = with pkgs; [
nyx # Command-line monitor for Tor
];
environment.persistence."/nix/persist" = {
directories = [
{ directory = "/var/lib/tor"; user = "tor"; group = "tor"; mode = "0700"; }
];
};
}