I require the use of a vpn with a proxy server.
I tried the following conf:
specialisation.vpn.configuration = {
environment.variables = rec{
http_proxy = "http://proxy.ip";
https_proxy = http_proxy;
no_proxy = "localhost,other.exeptions";
};
networking.networkmanager.dns = "default";
};
environment.systemPackages = with pkgs;[
(writeScriptBin "connectVpn" ''
set -euxo pipefail
function normal(){
/run/current-system/bin/switch-to-configuration test
}
trap normal EXIT
/run/current-system/specialisation/vpn/bin/switch-to-configuration test
#vpn connection cmd
'')
];
With the intention of using sudo connectVpn
to fully connect to my vpn.
However when I try to open a new terminal, the variables are not set appropriately. I’ve also tried networking.proxy, with little effect.
Why does it not set the appropriate variables?
How should I do it, considering that either I need to use the proxy when the vpn is active?