Today, I was in need of making the nixos installer trust a custom root CA (Certificate Authority) for TLS/SSL.
In the end, I managed to do it, so I will report here the steps needed (maybe some of them are unnecessary), with the hope that this post can serve to document this and be helpful to others.
These instructions are tailored for users of the graphical NixOS installer. If you’re using the minimal image, you can likely apply these same steps with minor adjustments.
I did it the following way:
- Launch the ISO with the nixos installer. As soon as it opens, the install GUI shows up, but immediately complains about not being able to reach the internet (in my case, this was because all TLS traffic was being intercepted and signed by a custom CA of the network security tool)
- Close the install GUI
- Obtain the root CA certificate in PEM format (e.g., using Firefox). Save it to a file, e.g., /ca.crt.
- Launch a new root shell
- In the terminal, run
export NIX_SSL_CERT_FILE=/ca.crt
(reference), cp /ca.crt /etc/ssl/certs
- Add this line to
/etc/nix/nix.conf
:ssl-cert-file = /ca.crt
- Run the nixos installer again. This time, it should not complain about SSL/TLS errors

- Once the installation is complete, in the installed system, you will probably need to trust the CA again. To do this:
1 Like