Skip to content

Commit

Permalink
tor: split out geoip data
Browse files Browse the repository at this point in the history
Saves about 5.2 MiB.

To use geoip, add something like
```
GeoIPFile ${tor.geoip}/share/tor/geoip
GeoIPv6File ${tor.geoip}/share/tor/geoip6
```
to torrc
  • Loading branch information
joachifm committed Mar 2, 2017
1 parent c5367a4 commit c44a41c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/tools/security/tor/default.nix
Expand Up @@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "0h8kpn42mgpkzmnga143hi8nh0ai65ypxh7qhkwbb15j3wz2h4fn";
};

outputs = [ "out" "geoip" ];

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libevent openssl zlib ] ++
stdenv.lib.optionals stdenv.isLinux [ libseccomp systemd libcap ];
Expand All @@ -22,6 +24,12 @@ stdenv.mkDerivation rec {
--replace 'exec torsocks' 'exec ${torsocks}/bin/torsocks'
'';

postInstall = ''
mkdir -p $geoip/share/tor
mv $out/share/tor/geoip{,6} $geoip/share/tor
rm -rf $out/share/tor
'';

doCheck = true;

meta = with stdenv.lib; {
Expand Down

0 comments on commit c44a41c

Please sign in to comment.