Nix installer doesn't work when dope.security is present on a machine
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
- [X] checked latest Nix manual (source)
- [X] checked open installer issues and pull requests for possible duplicates
Add :+1: to issues you find important.
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.
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
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.