feat: homebrew - darwin

This commit is contained in:
Ryan Yin
2023-12-22 21:23:23 +08:00
parent a9459e7606
commit a589feee7b

View File

@@ -29,6 +29,12 @@ let
# HTTP_PROXY = "http://127.0.0.1:7890";
# HTTPS_PROXY = "http://127.0.0.1:7890";
};
homebrew_env_script =
lib.attrsets.foldlAttrs
(acc: name: value: acc + "\nexport ${name}=${value}")
""
(homebrew_mirror_env // local_proxy_env);
in {
# Install packages from nix's official package repository.
#
@@ -54,17 +60,10 @@ in {
// homebrew_mirror_env;
# Set environment variables for nix-darwin before run `brew bundle`.
system.activationScripts.homebrew.text = let
env_script =
lib.attrsets.foldlAttrs
(acc: name: value: acc + "\nexport ${name}=${value}")
""
(homebrew_mirror_env // local_proxy_env);
in
lib.mkBefore ''
echo >&2 '${env_script}'
${env_script}
'';
system.activationScripts.homebrew.text = lib.mkBefore ''
echo >&2 '${homebrew_env_script}'
${homebrew_env_script}
'';
# Create /etc/zshrc that loads the nix-darwin environment.
# this is required if you want to use darwin's default shell - zsh