summaryrefslogtreecommitdiff
path: root/shell-scripts/nix-proxy
blob: f0b4ada3ae7fae152fd8b00158dac838aa31d1ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash
if [[ $(id -u) -ne 0 ]]; then
    echo "Should be run with sudo privileges"
    exit
fi
mkdir /run/systemd/system/nix-daemon.service.d/
cat << EOF >/run/systemd/system/nix-daemon.service.d/override.conf 
[Service]
Environment="http_proxy=$http_proxy"
Environment="https_proxy=$http_proxy"
Environment="all_proxy=$http_proxy"
EOF
systemctl daemon-reload
systemctl restart nix-daemon