mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 01:43:15 +00:00
rename torify to tsocks, to avoid name clashes and make it clear which wrapper library is used
This commit is contained in:
parent
633cc58d5c
commit
eb0874d5ff
@ -5,13 +5,13 @@ let
|
|||||||
cfg = config.services.tor;
|
cfg = config.services.tor;
|
||||||
|
|
||||||
torify = pkgs.writeTextFile {
|
torify = pkgs.writeTextFile {
|
||||||
name = "torify";
|
name = "tsocks";
|
||||||
text = ''
|
text = ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.stdenv.shell}
|
||||||
TSOCKS_CONF_FILE=${pkgs.writeText "tsocks.conf" cfg.torify.config} LD_PRELOAD="${pkgs.tsocks}/lib/libtsocks.so $LD_PRELOAD" "$@"
|
TSOCKS_CONF_FILE=${pkgs.writeText "tsocks.conf" cfg.tsocks.config} LD_PRELOAD="${pkgs.tsocks}/lib/libtsocks.so $LD_PRELOAD" "$@"
|
||||||
'';
|
'';
|
||||||
executable = true;
|
executable = true;
|
||||||
destination = "/bin/torify";
|
destination = "/bin/tsocks";
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
@ -22,12 +22,12 @@ in
|
|||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
services.tor.torify = {
|
services.tor.tsocks = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = cfg.client.enable;
|
default = cfg.enable && cfg.client.enable;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to build torify scipt to relay application traffic via TOR.
|
Whether to build tsocks wrapper script to relay application traffic via TOR.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,13 +53,13 @@ in
|
|||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf cfg.torify.enable {
|
config = mkIf cfg.tsocks.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ torify ]; # expose it to the users
|
environment.systemPackages = [ torify ]; # expose it to the users
|
||||||
|
|
||||||
services.tor.torify.config = ''
|
services.tor.tsocks.config = ''
|
||||||
server = ${toString(head (splitString ":" cfg.torify.server))}
|
server = ${toString(head (splitString ":" cfg.tsocks.server))}
|
||||||
server_port = ${toString(tail (splitString ":" cfg.torify.server))}
|
server_port = ${toString(tail (splitString ":" cfg.tsocks.server))}
|
||||||
|
|
||||||
local = 127.0.0.0/255.128.0.0
|
local = 127.0.0.0/255.128.0.0
|
||||||
local = 127.128.0.0/255.192.0.0
|
local = 127.128.0.0/255.192.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user