Skip to content

Instantly share code, notes, and snippets.

@djanatyn
Created October 31, 2022 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djanatyn/fd44bb3ac777479bc93421fe11c9fc7f to your computer and use it in GitHub Desktop.
Save djanatyn/fd44bb3ac777479bc93421fe11c9fc7f to your computer and use it in GitHub Desktop.
nix-shell vs nix shell
# why does `nix-shell` update NIX_LDFLAGS
# but `nix shell` does not?
❯ nix shell nixpkgs#libGLU -c /bin/sh -c 'env | grep -i glu'
PATH=/nix/store/xva8m3sa2yc56cglmqxgj3cdkq50hcly-glu-9.0.2/bin:/home/djanatyn/.zplug/repos/zplug/zplug/bin:/home/djanatyn/.zplug/bin:/usr/local/bin:/home/djanatyn/.local/bin:/nix/store/crrclzy9cqk55nlkcals81z1556c195c-kitty-0.26.2/bin:/nix/store/jwg4p52y4s69pyj9l8fmjc3xhckbl2rj-imagemagick-7.1.0-49/bin:/nix/store/5ki8qk489a2cmfc9sbjb2kwda8ymza3p-ncurses-6.3-p20220507-dev/bin:/run/wrappers/bin:/home/djanatyn/.nix-profile/bin:/etc/profiles/per-user/djanatyn/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
❯ nix-shell -p libGLU --command 'env | grep -i glu'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
NIX_CFLAGS_COMPILE= -isystem /nix/store/1gs13a2259qdbxjgx4vkw1my6a80vq4q-glu-9.0.1-dev/include -isystem /nix/store/mgky1qxwsj8268q8ivp41772pp6q1kq8-libGL-1.3.2-dev/include -isystem /nix/store/k8bkfl6lf5sgqikp2jrr2v3bdycai7r0-libglvnd-1.3.2-dev/include -isystem /nix/store/1gs13a2259qdbxjgx4vkw1my6a80vq4q-glu-9.0.1-dev/include -isystem /nix/store/mgky1qxwsj8268q8ivp41772pp6q1kq8-libGL-1.3.2-dev/include -isystem /nix/store/k8bkfl6lf5sgqikp2jrr2v3bdycai7r0-libglvnd-1.3.2-dev/include
buildInputs=/nix/store/1gs13a2259qdbxjgx4vkw1my6a80vq4q-glu-9.0.1-dev
NIX_SHELL_PACKAGES=libGLU
NIX_LDFLAGS=-rpath /nix/store/bak5i4hlhsd8pw9fs5qli0rlphsfk3y8-shell/lib64 -rpath /nix/store/bak5i4hlhsd8pw9fs5qli0rlphsfk3y8-shell/lib -L/nix/store/c1mcyl5jfald0y071jmhg5y1b8yz6il7-libGL-1.3.2/lib -L/nix/store/8wyp8jiwrcwr140fn8qyqmw1dssrlb6a-libglvnd-1.3.2/lib -L/nix/store/60j1whxw7h6zd2hyxla2zxz5sqhv3drn-glu-9.0.1/lib -L/nix/store/c1mcyl5jfald0y071jmhg5y1b8yz6il7-libGL-1.3.2/lib -L/nix/store/8wyp8jiwrcwr140fn8qyqmw1dssrlb6a-libglvnd-1.3.2/lib -L/nix/store/60j1whxw7h6zd2hyxla2zxz5sqhv3drn-glu-9.0.1/lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment