Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/proxychains: init #86225

Merged
merged 2 commits into from Nov 28, 2020
Merged

nixos/proxychains: init #86225

merged 2 commits into from Nov 28, 2020

Conversation

sorki
Copy link
Member

@sorki sorki commented Apr 28, 2020

Motivation for this change

Modular configuration for proxychains. After enabling, it allows running proxychains4 out of box proxying connections to Tor SOCKS when services.tor.client is enabled.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@sorki
Copy link
Member Author

sorki commented May 4, 2020

Proxies default now reflects services.tor.client.enable correctly.

Copy link
Member

@mmilata mmilata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alright.

@sorki sorki requested a review from infinisil June 16, 2020 12:34
@Lassulus
Copy link
Member

hey, sorry for the delay.
new services are encouraged to have a test with them. Can you add one?

nixos/modules/services/security/proxychains.nix Outdated Show resolved Hide resolved
${cfg.extraConfig}
'';

proxyOptions = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the sample config file (which I think would be great to put in proxychains $out), you can also pass a password, which is missing here yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done via f9bdbf2a13d9db1f51f7b361cb3de7cb68bea9ab

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've deliberately decided to not include user and password proxy options since it seems pretty obscure (the most common use-case is just running this with local Tor proxy) and poses a problem with passwords-in-store.

nixos/modules/services/security/proxychains.nix Outdated Show resolved Hide resolved
nixos/modules/services/security/proxychains.nix Outdated Show resolved Hide resolved
nixos/modules/services/security/proxychains.nix Outdated Show resolved Hide resolved
nixos/modules/services/security/proxychains.nix Outdated Show resolved Hide resolved
Comment on lines 173 to 175
services.proxychains.proxies = mkIf config.services.tor.client.enable
(mkDefault [{
type = "socks4";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be in this module, but rather in the tor one, and maybe behind an enable option

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to call the option - services.tor.client.proxychains.enable?

Looks like additional pitfall when you want to use proxychains with Tor - the sample proxychains.conf has Tor proxy enabled as well and we only enable it when tor.client is enabled.

nixos/modules/services/security/proxychains.nix Outdated Show resolved Hide resolved
@sorki
Copy link
Member Author

sorki commented Sep 8, 2020

  • Fixed mkEnableOption
  • Dropped extraArgs
  • Switched to programs.proxychains instead of services
  • attrsOf instead of listOf for programs.proxychain.proxies
  • Removed option applyies

@sorki
Copy link
Member Author

sorki commented Sep 9, 2020

Thanks for the suggestions Infinisil, also fixed the wording of the programs.proxychains.enable description to be rendered nicely in manual.

@sorki
Copy link
Member Author

sorki commented Nov 28, 2020

I think this is good to go.

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, looks good!

@infinisil infinisil merged commit cb59ff4 into NixOS:master Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants