nixos: tor: add enableGeoIP

This commit is contained in:
Jan Malakhovski 2017-03-11 17:55:12 +00:00
parent 00ed0f792e
commit 6d25f77a64
1 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,10 @@ let
torRc = '' torRc = ''
User tor User tor
DataDirectory ${torDirectory} DataDirectory ${torDirectory}
${optionalString cfg.enableGeoIP ''
GeoIPFile ${pkgs.tor.geoip}/share/tor/geoip
GeoIPv6File ${pkgs.tor.geoip}/share/tor/geoip6
''}
${optint "ControlPort" cfg.controlPort} ${optint "ControlPort" cfg.controlPort}
'' ''
@ -58,6 +62,18 @@ in
''; '';
}; };
enableGeoIP = mkOption {
type = types.bool;
default = true;
description = ''
Whenever to configure Tor daemon to use GeoIP databases.
Disabling this will disable by-country statistics for
bridges and relays and some client and third-party software
functionality.
'';
};
extraConfig = mkOption { extraConfig = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";