nix icon indicating copy to clipboard operation
nix copied to clipboard

Nix installer doesn't work when dope.security is present on a machine

Open guanchzhou opened this issue 1 year ago • 3 comments

Platform

  • [ ] Linux:
  • [X] macOS
  • [ ] WSL

Additional information

There is a security tool installed on a machine https://dope.security/. It is doing SSL inspection on-flight so sudo -i nix-channel --update nixpkgs command can't update packages and there is no flag to ignore SSL errors there.

Output

Output
warning: error: unable to download 'https://nixos.org/channels/nixpkgs-unstable': SSL peer certificate or SSH remote key was not OK (60) ; retrying in 330 ms
warning: error: unable to download 'https://nixos.org/channels/nixpkgs-unstable': SSL peer certificate or SSH remote key was not OK (60) ; retrying in 547 ms
warning: error: unable to download 'https://nixos.org/channels/nixpkgs-unstable': SSL peer certificate or SSH remote key was not OK (60) ; retrying in 1293 ms
warning: error: unable to download 'https://nixos.org/channels/nixpkgs-unstable': SSL peer certificate or SSH remote key was not OK (60) ; retrying in 2165 ms
error: unable to download 'https://nixos.org/channels/nixpkgs-unstable': SSL peer certificate or SSH remote key was not OK (60)

Checklist


Add :+1: to issues you find important.

guanchzhou avatar Feb 11 '25 14:02 guanchzhou

https://nix.dev/manual/nix/2.25/installation/env-variables#nix_ssl_cert_file may help to resolve issue but there is no any mention of that in installer's and/or nix-shell error.

guanchzhou avatar Feb 11 '25 15:02 guanchzhou

It sounds like that's the channel update step, and IIRC it's ~okay if that one fails. (I think it should have suggested updating it after the install?)

I haven't had to do this myself, but I suspect that you need something like the steps outlined in this comment:

  • https://github.com/NixOS/nix/issues/8081#issuecomment-1962419263

abathur avatar Feb 11 '25 16:02 abathur

Closing — this is an environment-specific SSL inspection issue (dope.security). Workaround is setting NIX_SSL_CERT_FILE per the manual. Not something I expect the installer to special-case.

guanchzhou avatar Sep 03 '26 12:09 guanchzhou