From a589feee7b592ecb35d5745281b832b2e7fcb1b2 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 22 Dec 2023 21:23:23 +0800 Subject: [PATCH] feat: homebrew - darwin --- modules/darwin/apps.nix | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/darwin/apps.nix b/modules/darwin/apps.nix index 83f0c779..068a337a 100644 --- a/modules/darwin/apps.nix +++ b/modules/darwin/apps.nix @@ -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