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

git does not work inside of nix-shell #16031

Closed
charles-cooper opened this issue Jun 7, 2016 · 2 comments
Closed

git does not work inside of nix-shell #16031

charles-cooper opened this issue Jun 7, 2016 · 2 comments

Comments

@charles-cooper
Copy link
Contributor

Issue description

git does not work in nix-shell. This seems to be an SSL related issue (cf. #15933, #15571, #13744).

Steps to reproduce

(I have both git and stack installed in the system-wide environment.)
In a Haskell project:

[charles@marmoset:~/machine]$ nix-shell -p git
[nix-shell:~/machine]$ stack build
Updating package index Hackage (mirrored at https://github.com/commercialhaskell                                                                                Running /nix/store/jhn7046bggnbjypibwhz7y014b89azcl-git-2.8.3/bin/git clone https://github.com/commercialhaskell/all-cabal-hashes.git all-cabal-hashes/ --depth 1 -b display in directory /home/charles/.stack/indices/Hackage/git-update/ exited with ExitFailure 128

Cloning into 'all-cabal-hashes'...
fatal: unable to access 'https://github.com/commercialhaskell/all-cabal-hashes.git/': error setting certificate verify locations:
  CAfile: /no-cert-file.crt
  CApath: none

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
[nix-shell:~/machine]$ nixos-version 
16.09pre84674.fbde3a7 (Flounder)
  • Nix version: (run nix-env --version)
[nix-shell:~/machine]$ nix-env --version
nix-env (Nix) 1.11.2
  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)
    "16.09pre84674.fbde3a7"
@mogorman
Copy link
Contributor

mogorman commented Jun 7, 2016

shellHook = ''
    export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
'';

will fix your problem

@FRidh
Copy link
Member

FRidh commented Jun 7, 2016

You can indeed fix it for now by setting the shellHook or, in the case you're running NixOS, by setting environment.variables."SSL_CERT_FILE" = "/etc/ssl/certs/ca-bundle.crt";.
Because this is a duplicate of the issues you refer to I am closing this.

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

3 participants