Can't activate with direnv on MacOS

Activation doesn’t work with direnv on MacOS.
I have an environment malagant/shop with an .envrc file in the project directory.
When cd into the directory direnv reports direnv: loading ~/projects/detox/sources/worktrees/rails6/.envrc but the environment is not activated.
The only content of the .envrc file is . <(flox activate -e malagant/shop).

Any advice?

Cheers
Michael

Thanks for the report!

I’m having trouble reproducing. I’m on macOS Ventura

~ > flox install -e tmp ripgrep
created generation 1
~  > cat ~/floxEnv/.envrc 
. <(flox activate -e mkenigs/tmp)
~  > cd ~/floxEnv
direnv: loading ~/floxEnv/.envrc
direnv: export ~FLOX_ACTIVE_ENVIRONMENTS ~FLOX_PROMPT_ENVIRONMENTS ~PATH ~XDG_DATA_DIRS
~/floxEnv> which rg
/Users/matthew/.local/share/flox/environments/mkenigs/aarch64-darwin.tmp/bin/rg

If you put . <(flox --debug activate -e malagant/shop) in your .envrc that might give us a bit more info?

❯ z rails6
direnv: loading ~/projects/detox/sources/worktrees/rails6/.envrc
[DEBUG] [flox::config] `$FLOX_CONFIG_HOME` not set, using "/Users/mjohann/.config/flox/"
[DEBUG] [flox::config] `FLOX_CONFIG_HOME` not set, using "/Users/mjohann/.config/flox/"
[DEBUG] [flox::utils::init::metrics] Attempting to read own UUID from file
[DEBUG] [flox] Running in flox with arguments: ["--debug", "activate", "-e", "malagant/shop"]
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:149 hash_commands( ansifilter awk basename bash cat chmod cmp column cp curl cut dasel date dirname getent gh git grep gum id jq ln man mkdir mktemp mv nix nix-editor nix-store pwd readlink realpath rm rmdir sed sh sleep sort stat tail tar tee touch tr uname uuid xargs zgrep )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:169 first_in_PATH( vim vi nano emacs ed )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/bootstrap.sh:25 floxUserMetaRegistry( get floxClientUUID )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:693 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA 1 get floxClientUUID )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA --args -- get floxClientUUID )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/bootstrap.sh:27 floxUserMetaRegistry( get floxClientUUID )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:693 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA 1 get floxClientUUID )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA --args -- get floxClientUUID )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/bootstrap.sh:70 floxUserMetaRegistry( get gitBaseURL )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:693 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA 1 get gitBaseURL )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA --args -- get gitBaseURL )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/bootstrap.sh:72 floxUserMetaRegistry( get floxMetricsConsent )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:693 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA 1 get floxMetricsConsent )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA --args -- get floxMetricsConsent )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/init.sh:344 updateFloxFlakeRegistry(  )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:1225 getChannelsJSON(  )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:1203 floxUserMetaRegistry( get channels )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:693 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA 1 get channels )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.63hgwu20kA --args -- get channels )
trace:/dev/fd/63:1 invoke( /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/nix registry add --registry /Users/mjohann/.config/flox/tmp.TTlVRNZjhu flox github:flox/floxpkgs/master )
trace:/dev/fd/63:2 invoke( /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/nix registry add --registry /Users/mjohann/.config/flox/tmp.TTlVRNZjhu nixpkgs-flox github:flox/nixpkgs-flox/master )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:1232 invoke( /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/nix registry add --registry /Users/mjohann/.config/flox/tmp.TTlVRNZjhu nixpkgs github:flox/nixpkgs/stable )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:1233 invoke( /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/nix registry add --registry /Users/mjohann/.config/flox/tmp.TTlVRNZjhu nixpkgs-stable github:flox/nixpkgs/stable )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:1234 invoke( /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/nix registry add --registry /Users/mjohann/.config/flox/tmp.TTlVRNZjhu nixpkgs-staging github:flox/nixpkgs/staging )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:1235 invoke( /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/nix registry add --registry /Users/mjohann/.config/flox/tmp.TTlVRNZjhu nixpkgs-unstable github:flox/nixpkgs/unstable )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/flox:132 submitMetric( activate )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/flox:168 environmentArg( malagant/shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/flox:198 floxActivate( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop aarch64-darwin )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:154 doAutoUpdate( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:157 updateAvailable( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1117 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1126 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.QHkRT4Pr5V 1 get currentGen )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.QHkRT4Pr5V --args -- get currentGen )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1131 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.QHkRT4Pr5V 1 get currentGen )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.QHkRT4Pr5V --args -- get currentGen )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:154 doAutoUpdate( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:157 updateAvailable( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1117 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1126 registry( /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.AFt3wIP5y1 1 get currentGen )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/utils.sh:611 invoke( /nix/store/hq0xl41bv0z7jh3r39csn9lczfk7cf10-jq-1.6-bin/bin/jq -S -n -e -r -f /nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/registry.jq --arg version 1 --slurpfile registry /var/folders/_y/jyzcttgs1jqcnhlqc0hfxzfw0000gn/T/tmp.AFt3wIP5y1 --args -- get currentGen )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:171 trailingAsyncFetch( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1165 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1165 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1173 _trailingAsyncFetch( /Users/mjohann/.cache/flox/meta/malagant )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:183 identifyParentShell(  )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:1155 githubHelperGit( -C /Users/mjohann/.cache/flox/meta/malagant fetch origin )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/metadata.sh:368 invoke( /nix/store/l5100vm321ay7i2kanfcai6na1dp6lqx-git-minimal-2.39.1/bin/git -c 'credential.https://github.com.helper=!/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/gh auth git-credential' -C /Users/mjohann/.cache/flox/meta/malagant fetch origin )
+ /nix/store/l5100vm321ay7i2kanfcai6na1dp6lqx-git-minimal-2.39.1/bin/git -c 'credential.https://github.com.helper=!/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/libexec/flox/gh auth git-credential' -C /Users/mjohann/.cache/flox/meta/malagant fetch origin
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:210 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:210 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:216 joinString( : /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop/bin /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/bin '/Users/mjohann/miniconda/bin:/Users/mjohann/miniconda/condabin:/Users/mjohann/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-bench:/opt/homebrew/opt/postgresql@15/bin:/Users/mjohann/.asdf/shims:/Users/mjohann/.rd/bin:/Users/mjohann/.asdf/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/mjohann/.yarn/bin:/Users/mjohann/.config/yarn/global/node_modules/.bin:/Users/mjohann/.krew/bin:/Users/mjohann/.local/bin:/opt/local/bin:/opt/local/sbin:/Users/mjohann/.rbenv/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/mjohann/.cargo/bin:/Users/mjohann/.fig/bin:/Users/mjohann/.local/bin:/Users/mjohann/Library/Application Support/JetBrains/Toolbox/scripts:/Users/mjohann/.local/share/fig/plugins/blackbox/bin' )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:217 joinString( : /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop/share /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/share '' )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:218 joinString( : /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default '' )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:219 joinString( ' ' shop default '' )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:247 bashRC( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:20 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:22 invoke( /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop/activate )
+ /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop/activate
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:20 decodeEnvironment( /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default )
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:22 invoke( /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/activate )
+ /nix/store/7izm8w3c60v9ap2d7caq31rv2ppazasj-coreutils-9.1/bin/cat /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/activate
trace:/nix/store/8xjb4id3ckd1zp85vjcpl250bl56iq0j-flox-0.0.10-r204/lib/commands/activate.sh:308 darwinRepairFiles(  )
(⎈|rancher-desktop:N/A)(base)
rails6 on  rails6 [$✘!+⇕] via 🐳 desktop-linux is 📦 v1.0.0 via  v18.13.0 via 💎 v2.7.7
❯

When I execute it directly in the shell it adds the following:

fpath=(/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/share/zsh/site-functions /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop /Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/share/zsh/vendor-completions $fpath)
autoload -U compinit && compinit
export SSL_CERT_FILE="${SSL_CERT_FILE:-/nix/store/s4blnzinsjx0891ssrp3mphsam58psdp-nss-cacert-3.86/etc/ssl/certs/ca-bundle.crt}"
export NIX_SSL_CERT_FILE="${NIX_SSL_CERT_FILE:-$SSL_CERT_FILE}"
export NIX_COREFOUNDATION_RPATH="/nix/store/sw2zrmkm5kqp8klvlsa2acvhfsff51pg-apple-framework-CoreFoundation-11.0.0/Library/Frameworks"
export PATH_LOCALE="/nix/store/cjq36wj1jb7g7bfna8n2qy8kzc16slll-adv_cmds-119-locale/share/locale"
export PATH="/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop/bin:/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/bin:/Users/mjohann/miniconda/bin:/Users/mjohann/miniconda/condabin:/Users/mjohann/Library/Caches/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-bench:/opt/homebrew/opt/postgresql@15/bin:/Users/mjohann/.asdf/shims:/Users/mjohann/.rd/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/mjohann/.yarn/bin:/Users/mjohann/.config/yarn/global/node_modules/.bin:/Users/mjohann/.krew/bin:/Users/mjohann/.local/bin:/opt/local/bin:/opt/local/sbin:/Users/mjohann/.rbenv/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/mjohann/.cargo/bin:/Users/mjohann/.fig/bin:/Users/mjohann/Library/Application:Support/JetBrains/Toolbox/scripts:/Users/mjohann/.local/share/fig/plugins/blackbox/bin"
export XDG_DATA_DIRS="/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop/share:/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default/share"
export FLOX_ACTIVE_ENVIRONMENTS="/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.shop:/Users/mjohann/.local/share/flox/environments/malagant/aarch64-darwin.default"
export FLOX_PROMPT_ENVIRONMENTS="shop default"
export FLOX_PROMPT_COLOR_1="61"
export FLOX_PROMPT_COLOR_2="216"











# Tweak the (already customized) prompt: add a flox indicator.
_floxPrompt1="%F{${FLOX_PROMPT_COLOR_1}}flox"
_floxPrompt2="%F{$FLOX_PROMPT_COLOR_2}[$FLOX_PROMPT_ENVIRONMENTS]"
_flox="%B${FLOX_PROMPT-$_floxPrompt1} ${_floxPrompt2}%f%b "


if [ -n "$_flox" -a -n "$PS1" ]
then
    # Start by saving the original value of PS1.
    if [ -z "$FLOX_SAVE_PS1" ]; then
        export FLOX_SAVE_PS1="$PS1"
    fi
    case "$FLOX_SAVE_PS1" in
        # If the prompt contains an embedded newline,
        # then insert the flox indicator immediately after
        # the (first) newline.
        *\\n*)      PS1="${FLOX_SAVE_PS1/\\n/\\n$_flox}";;
        *\\012*)    PS1="${FLOX_SAVE_PS1/\\012/\\012$_flox}";;

        # Otherwise, prepend the flox indicator.
        *)          PS1="$_flox$FLOX_SAVE_PS1";;
    esac

    # TODO: figure out zsh way of setting window and icon title.
fi

unset _flox _floxPrompt1 _floxPrompt2
flox [shop default] (⎈|rancher-desktop:N/A)(base)
rails6 on  rails6 [$✘!+⇕] via 🐳 desktop-linux is 📦 v1.0.0 via  v18.14.1 via 💎 v2.7.7

Is there any chance git authentication might be hanging? I’m using ssh with a yubikey and I have to authenticate for the activation to complete with direnv

I doubt it. It’s working directly in the shell.
In the meantime, I had a call with Tom from your team and we figured out that this is a problem with the precedence of PATH entries. Flox seems too kind regarding the position in the PATH env variable. Modifying the .envrc file and exporting the environment path, in the beginning, fixed it. Tom took it into engineering to make the workaround for the product.

1 Like

Could you take a look at this solution Direnv, project environment and zsh - #12 by aameen and let me know if that resolves your issue?

I believe this might be similar.

If you explicitly set . <( flox activate -e '.#default'; ); it might do the trick. There’s some additional direnv for “project environments” snippets in this thread as well: Is it possible to change the name of a project environment after having created it? - #8 by aameen