mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-02-23 00:14:49 +01:00
feat: homebrew - darwin
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user