Flox env activation failed

Hi I am facing some issues with flox env activation.

/Users/alpha/.flox/run/aarch64-darwin.default/activate: line 175: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed: No such file or directory
/Users/alpha/.flox/run/aarch64-darwin.default/activate: line 176: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed: No such file or directory
/Users/alpha/.flox/run/aarch64-darwin.default/activate.d/zsh:62: no such file or directory: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed
/Users/alpha/.flox/run/aarch64-darwin.default/activate.d/zsh:63: no such file or directory: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed

There is only single environment.

❯ flox envs
✨ Active environments:
  default  /Users/alpha

The flox was installed as nix profile and had only one package.

❯ nix profile list
Name:               flox
Flake attribute:    packages.aarch64-darwin.default
Original flake URL: github:flox/flox
Locked flake URL:   github:flox/flox/801c6f36ea85c3fb7a1fff07128f03f22095bf4b?narHash=sha256-I7vhEXCRs6uUMWl9Iw8vpAPD/3L9NmG1H4WBl03pOnM%3D
Store paths:        /nix/store/1b0sa6m1vr3vkxr87p1py677cb1cz42d-flox-1.0.6-g801c6f3

So far had tried.

  1. Existing/Activating env again
  2. Removing env with flox delete -d "/Users/alpha" and adding the .flox/env/manifest.toml` file back and activating again.
  3. Removing flox via nix profile remove flox and then installing as fresh but yet still the same issue.
  4. Removing flox cache rm -r .flox/cache and flox run rm -r .flox/run and activating env again.
  5. Installing gnused as nix profile install nixpkgs#gnused

Any suggestion how to get pass this issue?

we’re taking a look!

We’ll look into this further but in the meantime the following command should provide a workaround to get you back up and running:

nix-store -r /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9

Please let me know if that doesn’t work. Many thanks for the bug report!

Unfortunately it didn’t work. Here are some warnings that may be helpfull to debug.

❯ nix-store -r /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9

warning: ignoring the client-specified setting 'trusted-public-keys', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'trusted-substituters', because it is a restricted setting and you are not a trusted user
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9

I am not good at Nix so can’t figure out how the hash for the package is created.

I observed that it’s looking for the following directory which never existed.

/nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/

But if I install via nix profile install nixpkgs#gnused it have a different hash.

/nix/store/gnq3l6ixidmzhb93fx0lk11l9622iwc4-gnused-4.9

So the earlier version probably be the local dependency for the flox.

I found a workaround for me.

I used following command to install the gnused packag.e

nix profile install nixpkgs#gnused

It was installed on

❯ nix profile list
Name:               flox
Flake attribute:    packages.aarch64-darwin.default
Original flake URL: github:flox/flox
Locked flake URL:   github:flox/flox/801c6f36ea85c3fb7a1fff07128f03f22095bf4b?narHash=sha256-I7vhEXCRs6uUMWl9Iw8vpAPD/3L9NmG1H4WBl03pOnM%3D
Store paths:        /nix/store/1b0sa6m1vr3vkxr87p1py677cb1cz42d-flox-1.0.6-g801c6f3

Name:               gnused
Flake attribute:    legacyPackages.aarch64-darwin.gnused
Original flake URL: flake:nixpkgs
Locked flake URL:   github:NixOS/nixpkgs/4a4ecb0ab415c9fccfb005567a215e6a9564cdf5?narHash=sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU%3D
Store paths:        /nix/store/gnq3l6ixidmzhb93fx0lk11l9622iwc4-gnused-4.9

Then I copied all files and directories form /nix/store/gnq3l6ixidmzhb93fx0lk11l9622iwc4-gnused-4.9 to the path it was complaining /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9.

And then removed the package via nix profile remove gnused.

Everything seems to work fine for me now.