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

NIX_PATH is not updated after nixos-rebuild switch #13

Open
milahu opened this issue Oct 22, 2023 · 0 comments
Open

NIX_PATH is not updated after nixos-rebuild switch #13

milahu opened this issue Oct 22, 2023 · 0 comments

Comments

@milahu
Copy link
Owner

milahu commented Oct 22, 2023

either this is deliberate to keep the system stable
or this is not implemented because it affects the legacy nix tools nix-shell and nix-build

environment

nixpkgs 01441e1

reproduce

$ echo $NIX_PATH | tr : $'\n' | grep ^nixpkgs=
nixpkgs=/nix/store/qb3dg4cx5jzk3pa8szzi0ziwnqy33p50-source

$ ( cd /etc/nixos && sudo nix flake lock --update-input nixpkgs )

$ sudo nixos-rebuild switch

$ echo $NIX_PATH | tr : $'\n' | grep ^nixpkgs=
nixpkgs=/nix/store/qb3dg4cx5jzk3pa8szzi0ziwnqy33p50-source

$ source /etc/set-environment

$ echo $NIX_PATH | tr : $'\n' | grep ^nixpkgs=
nixpkgs=/nix/store/0axp4y6hffffs95l5865szvpcmq9g08p-source

problem

/etc/profile

  if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
      . /nix/store/4rd12751lhvvinlkcc0ij3rs2h6g2r4l-set-environment
  fi

workaround

~/.bashrc

# force update of NIX_PATH
# FIXME this should be done somewhere else...
# usually in /etc/profile but that has
#   if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then
#       . /nix/store/4rd12751lhvvinlkcc0ij3rs2h6g2r4l-set-environment
#   fi
source /etc/set-environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant