1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-18 10:30:23 -04:00

Set proxy config for daemon during installation on Darwin

Signed-off-by: Zhongcheng Lao <laozhongcheng@gmail.com>
This commit is contained in:
Zhongcheng Lao 2023-07-01 22:27:50 +08:00
parent d05d175ddf
commit 3a47e9e53f

View file

@ -102,6 +102,14 @@ poly_configure_nix_daemon_service() {
_sudo "to set up the nix-daemon as a LaunchDaemon" \
/usr/bin/install -m -rw-r--r-- "/nix/var/nix/profiles/default$NIX_DAEMON_DEST" "$NIX_DAEMON_DEST"
vars="http_proxy https_proxy ftp_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY"
for v in $vars; do
if [ "x${!v:-}" != "x" ]; then
_sudo "to set the ${v} setting for nix-daemon" \
plutil -replace "EnvironmentVariables.${v}" -string "${!v}" "$NIX_DAEMON_DEST"
fi
done
_sudo "to load the LaunchDaemon plist for nix-daemon" \
launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist