From 95ef8b16941c3da6a5144bfd8d7b1345eb0d5e3f Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Sun, 22 Feb 2009 16:06:27 +0000 Subject: [PATCH] Option for proxy usage in Nix daemon Signed-off-by: Nicolas Pierron svn path=/nixos/branches/fix-style/; revision=14156 --- system/options.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/system/options.nix b/system/options.nix index 7c4b5def367b..dfb1019d864a 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1933,6 +1933,16 @@ in on the remote machine. "; }; + + proxy = mkOption { + default = ""; + description = " + This option specifies the proxy to use for fetchurl. The real effect + is just exporting http_proxy, https_proxy and ftp_proxy with that + value. + "; + example = "http://127.0.0.1:3128"; + }; # Environment variables for running Nix. envVars = mkOption { @@ -1962,7 +1972,16 @@ in export NIX_REMOTE_SYSTEMS=/etc/nix.machines export NIX_CURRENT_LOAD=/var/run/nix/current-load '' - else "") + conf; + else "") + + + (if config.nix.proxy != "" then + '' + export http_proxy=${config.nix.proxy} + export https_proxy=${config.nix.proxy} + export ftp_proxy=${config.nix.proxy} + '' + else "") + + conf; }; };