Skip to content

Instantly share code, notes, and snippets.

@hnaderi
Created August 21, 2023 14:45
Show Gist options
  • Save hnaderi/cb373f6393211d5fcfa17597b2f7b562 to your computer and use it in GitHub Desktop.
Save hnaderi/cb373f6393211d5fcfa17597b2f7b562 to your computer and use it in GitHub Desktop.
Set temporary proxy for nix-daemon
#!/usr/bin/env bash
rm /run/systemd/system/nix-daemon.service.d/proxy-override.conf
systemctl daemon-reload
systemctl restart nix-daemon
#!/usr/bin/env bash
PROXY=$1
mkdir -p /run/systemd/system/nix-daemon.service.d/
cat << EOF >/run/systemd/system/nix-daemon.service.d/proxy-override.conf
[Service]
Environment="http_proxy=$PROXY"
Environment="https_proxy=$PROXY"
Environment="all_proxy=$PROXY"
EOF
systemctl daemon-reload
systemctl restart nix-daemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment