Giter VIP home page Giter VIP logo

Comments (7)

abathur avatar abathur commented on September 28, 2024 1

NIX_PROFILES actually is space-delimited, so that should be fine. (And ~/.nix-profile will only get created as-needed--that shouldn't be a problem, either.)

 ~  nix-shell
error: path '/Users/philipp/default.nix' does not exist

This indicates that nix is present on your PATH, now--so I think you're sorted. Either something you've tried changing, or perhaps restarting your shell, has fixed it. You should be able to confirm with nix-shell -p hello or somesuch.

from nix.

abathur avatar abathur commented on September 28, 2024

Nix not being on PATH generally points to your shell init files either hard-setting a PATH that doesn't include Nix after Nix's shell hook ran (often from one of the user-specific init files in ~/), or perhaps having an early return condition in the relevant init file that is keeping the shell hook from running at all.

If env | grep NIX shows a few variables, that's a good sign the shell hook is at least running and you can focus on looking for what might be overwriting PATH.

from nix.

brandshaide avatar brandshaide commented on September 28, 2024

@abathur thanks for your support, that's really odd I've checked all the possible dotfiles in my homedir such as

# ~ ls -a | grep ".zsh*"
.oh-my-zsh
.shell.pre-oh-my-zsh
.zsh_history
.zsh_sessions
.zshenv
.zshrc

Included a print checking whether zshrc is picking up nix-daemon.sh (it does) and even sourced the file manually after starting a shell - but with no effect.

And shell hook seems to be running indeed:

env | grep nix
NIX_PROFILES=/nix/var/nix/profiles/default /Users/philipp/.nix-profile
XDG_DATA_DIRS=/usr/local/share:/usr/share:/Users/philipp/.nix-profile/share:/nix/var/nix/profiles/default/share
NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
# echo $PATH
/Users/philipp/.opam/default/bin:/usr/local/share:/usr/share:/Users/philipp/.nix-profile/share:/nix/var/nix/profiles/default/share:/nix/var/nix/profiles/default /Users/philipp/.nix-profile

Also tried this workaround

from nix.

abathur avatar abathur commented on September 28, 2024
# echo $PATH
/Users/philipp/.opam/default/bin:/usr/local/share:/usr/share:/Users/philipp/.nix-profile/share:/nix/var/nix/profiles/default/share:/nix/var/nix/profiles/default /Users/philipp/.nix-profile

The last separator in this PATH is a space instead of a semicolon; I guess it might be breaking the PATH search for both of the last two entries.

If PATH="/Users/philipp/.opam/default/bin:/usr/local/share:/usr/share:/Users/philipp/.nix-profile/share:/nix/var/nix/profiles/default/share:/nix/var/nix/profiles/default:/Users/philipp/.nix-profile" type nix-shell finds the executable, then you'll need to figure out where/how the space is slipping in.

from nix.

brandshaide avatar brandshaide commented on September 28, 2024

@abathur sorry, this has been an c&p error, actually there's no whitespace - but see below, there's no Users/<myuser>/.nix-profile directory existent.

env | grep nix
PATH=/Users/philipp/.opam/default/bin:/Users/philipp/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/philipp/go/bin/tparse:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/bin/python3:/opt/homebrew/Cellar/zplug/2.4.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/philipp/.cargo/bin
NIX_PROFILES=/nix/var/nix/profiles/default:/Users/philipp/.nix-profile
XDG_DATA_DIRS=/usr/local/share:/usr/share:/Users/philipp/.nix-profile/share:/nix/var/nix/profiles/default/share
NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt

 ~  nix-shell
error: path '/Users/philipp/default.nix' does not exist

from nix.

brandshaide avatar brandshaide commented on September 28, 2024

in nix-daemon.sh its:

export NIX_PROFILES="/nix/var/nix/profiles/default $NIX_LINK"

aint it supposed to be:

export NIX_PROFILES="/nix/var/nix/profiles/default:$NIX_LINK"

from nix.

brandshaide avatar brandshaide commented on September 28, 2024

thanks a lot for your support, I ended up by just copying setting up/exporting the PATH from nix-daemon.sh directly into my zshrc like this:

NIX_LINK=$HOME/.nix-profile
export NIX_PROFILES="/nix/var/nix/profiles/default:$NIX_LINK"
export XDG_DATA_DIRS="/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
export PATH="$NIX_LINK/bin:/nix/var/nix/profiles/default/bin:$PATH"

Still haven't been able to figure out why my PATH haven't been set up correctly but at least it's working now

from nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.