anchor.diff:  
       AllowInbound ${if cfg.allowInbound then "1" else "0"}
     '';
  +
  +  wrapTorsocks = name: server: pkgs.writeTextFile {
  +    name = name;
  +    text = ''
  +        #!${pkgs.stdenv.shell}
  +        TORSOCKS_CONF_FILE=${pkgs.writeText "torsocks.conf" (configFile server)} ${pkgs.torsocks}/bin/torsocks "$@"
  +    '';
  +    executable = true;
  +    destination = "/bin/${name}";
  +  };
  +
   in
   {
     options = {
  
positive.code:   };
  
    config = mkIf cfg.enable {
      environment.systemPackages = [ pkgs.torsocks ];
  
      environment.etc =
        [ { source = pkgs.writeText "torsocks.conf" configFile;
            target = "tor/torsocks.conf";
          }
        ];
  
negative.code:         description = ''
            IP/Port of the Tor SOCKS server. Currently, hostnames are
            NOT supported by torsocks.
          '';
        };
  
        fasterServer = mkOption {
          type    = types.str;
          default = "127.0.0.1:9063";
          example = "192.168.0.20:1234";
          description = ''
            IP/Port of the Tor SOCKS server for torsocks-faster wrapper suitable for HTTP.
            Currently, hostnames are NOT supported by torsocks.
          '';
        };
  
  