Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling nix-shell from nix repl does not work on macOS #12163

Open
2 tasks done
thesoundhead opened this issue Jan 9, 2025 · 3 comments
Open
2 tasks done

Calling nix-shell from nix repl does not work on macOS #12163

thesoundhead opened this issue Jan 9, 2025 · 3 comments
Labels

Comments

@thesoundhead
Copy link

thesoundhead commented Jan 9, 2025

Describe the bug

Under macOS Sonoma 14.7.2 (tested with a M1 and Intel machine), I get the following error message when trying to open a nix shell from nix repl, using :u:

error: Cannot run 'nix-shell' because no method of calling the Nix CLI was provided. This is a configuration problem pertaining to how this program was built. See Nix 2.25 release notes

Steps To Reproduce

  1. Start nix repl with nixpkgs: nix repl --expr 'import (builtins.getFlake "nixpkgs") {}'
  2. Try building pkgs.hello and starting nix-shell: :u pkgs.hello
  3. Get the error message from above

Expected behavior

A nix shell is opened from the nix repl with the hello package available.

Metadata

nix-env (Nix) 2.25.3

Additional context

  • Nix has been installed using the Determinate Systems installer
  • Looking into the Nix 2.25 release notes, as suggested by the error message did not reveal any insights

Checklist

@tfc
Copy link
Contributor

tfc commented Jan 9, 2025

I also had this problem on a system once on a normal x86_64 NixOS system but can't reproduce it right now.

It also seems like the Release notes don't contain anything as mentioned in the error message.

@tfc
Copy link
Contributor

tfc commented Jan 15, 2025

Now it's popping up on another NixOS machine:

$ nix --version
nix (Nix) 2.25.2

$ nix repl --file '<nixpkgs>'
Nix 2.25.2
Type :? for help.
Loading installable ''...
Added 23137 variables.
nix-repl> :u pkgs.hello
error: Cannot run 'nix-shell' because no method of calling the Nix CLI was provided. This is a configuration problem pertaining to how this program was built. See Nix 2.25 release notes

@marijanp
Copy link

I'm experiencing the same issue on x86_64-linux on NixOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants