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_SSL_CERT_FILE is different if you use --run vs running same command manually in the shell #6883

Open
sheldonneuberger opened this issue Aug 8, 2022 · 1 comment
Labels

Comments

@sheldonneuberger
Copy link

Describe the bug

NIX_SSL_CERT_FILE is /no-cert-file.crt when running env with --run, but it's /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt when running env manually in the shell that opens.

Steps To Reproduce

  1. nix-shell --pure -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/2f0c3be57c348f4cfd8820f2d189e29a685d9c41.tar.gz -p coreutils --run "env" > a
  2. nix-shell --pure -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/2f0c3be57c348f4cfd8820f2d189e29a685d9c41.tar.gz -p coreutils then run env > b in the shell that opens.
  3. diff a b
$ diff a b
14a15
> NIX_PROFILES=/nix/var/nix/profiles/default /Users/me/.nix-profile
26c27
< buildCommandPath=/private/tmp/nix-shell-57690-0/.attr-0
---
> buildCommandPath=/private/tmp/nix-shell-57896-0/.attr-0
33c34
< NIX_SSL_CERT_FILE=/no-cert-file.crt
---
> NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt

Expected behavior

Expected NIX_SSL_CERT_FILE to be /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt when using --run.

nix-env --version output
nix-env (Nix) 2.10.3, on macos

@thufschmitt
Copy link
Member

I can't reproduce it. NIX_SSL_CERT_FILE is always set to /no-cert-file.crt – which seems to be the right choice given the overall semantics of --pure.

What probably happens is that there's something in your bash rc scripts that sets NIX_SSL_CERT_FILE to /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt

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

2 participants