<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tomek Bawor on Medium]]></title>
        <description><![CDATA[Stories by Tomek Bawor on Medium]]></description>
        <link>https://medium.com/@tomekbawor?source=rss-39d0d64f596f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7tp7zwKlTMuA-BMG.jpg</url>
            <title>Stories by Tomek Bawor on Medium</title>
            <link>https://medium.com/@tomekbawor?source=rss-39d0d64f596f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 09:22:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomekbawor/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Nix Darwin on MacOs with zscaler]]></title>
            <link>https://medium.com/@tomekbawor/nix-darwin-on-macos-with-zscaler-af164f7ea4b9?source=rss-39d0d64f596f------2</link>
            <guid isPermaLink="false">https://medium.com/p/af164f7ea4b9</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[nix]]></category>
            <category><![CDATA[darwin]]></category>
            <dc:creator><![CDATA[Tomek Bawor]]></dc:creator>
            <pubDate>Mon, 18 Aug 2025 09:09:20 GMT</pubDate>
            <atom:updated>2025-08-18T09:09:20.122Z</atom:updated>
            <content:encoded><![CDATA[<p>Once upon a time I have tried to install nix package manager into my work macbook. I have been looking for the same terminal setup for all of my machines that can be easily stored in one place.</p><p>This however was not so easy since my work macbook has pre installed zscaler which rips open the TLS connections and replaces the certificates with company accepted one.</p><p>I have spent too many hours that I would like to admit on searching why my nix commands are not working and I have errors with SSL certificates. Since I have set up my computer many years ago, the zscaler did not gave issues and I forgot it exists.</p><p>Here is the instruction for people struggling with the same problem, or my colleagues if I ever convince them to use Nix.</p><h3>Step 1: Export Trusted Certificates from MacOS Keychain</h3><p>Use the security tool to export certificates from the system keychains:</p><p>bashCopy</p><pre>security export -t certs -f pemseq -k /Library/Keychains/System.keychain -o /tmp/certs-system.pem<br>security export -t certs -f pemseq -k /System/Library/Keychains/SystemRootCertificates.keychain -o /tmp/certs-root.pem<br>cat /tmp/certs-root.pem /tmp/certs-system.pem &gt; /tmp/ca_cert.pem</pre><p>This creates a single ca_cert.pem bundle from both the system and root certificates.</p><h3>Step 2: Move Certificate Bundle to Nix Directory</h3><p>Copy the combined certificate bundle to a location where the Nix daemon can access it:</p><p>bashCopy</p><pre>sudo mv /tmp/ca_cert.pem /etc/nix/</pre><h3>Step 3: Configure Nix Daemon to Use the Certificate</h3><p>Edit the nix-daemon launch daemon configuration:</p><p>bashCopy</p><pre>sudo vim /Library/LaunchDaemons/org.nixos.nix-daemon.plist</pre><p>Add or ensure the following entries exist underEnvironmentVariables It is just an example, there may be other entries that I would not change. This is just an example.</p><p>xmlCopy</p><pre>&lt;key&gt;EnvironmentVariables&lt;/key&gt;<br>&lt;dict&gt;<br>  &lt;key&gt;NIX_SSL_CERT_FILE&lt;/key&gt;<br>  &lt;string&gt;/etc/nix/ca_cert.pem&lt;/string&gt;<br>  &lt;key&gt;SSL_CERT_FILE&lt;/key&gt;<br>  &lt;string&gt;/etc/nix/ca_cert.pem&lt;/string&gt;<br>  &lt;key&gt;REQUEST_CA_BUNDLE&lt;/key&gt;<br>  &lt;string&gt;/etc/nix/ca_cert.pem&lt;/string&gt;<br>&lt;/dict&gt;</pre><h3>Step 4: Restart the Nix Daemon</h3><p>After saving the file, you may restart the Nix daemon. This is reported to work for some people, not for me though… I needed to reboot my computer.</p><p>bashCopy</p><pre>sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist<br>sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist</pre><h3>Step 5: Export Environment Variables (Optional)</h3><p>If the above steps don’t fully solve the issue, you may also want to export the certificate path manually in your shell:</p><p>bashCopy</p><pre>export NIX_SSL_CERT_FILE=/etc/nix/ca_cert.pem<br>export SSL_CERT_FILE=/etc/nix/ca_cert.pem</pre><p>Just to be sure I have included setting up this environment variables in my nix config by adding following lines to my darwin config.</p><p>nixCopy</p><pre>environment.variables = {<br>    NIX_SSL_CERT_FILE = &quot;/etc/nix/ca_cert.pem&quot;;<br>    SSL_CERT_FILE = &quot;/etc/nix/ca_cert.pem&quot;;<br>    REQUEST_CA_BUNDLE = &quot;/etc/nix/ca_cert.pem&quot;;<br>};</pre><h3>References</h3><ul><li><a href="https://discourse.nixos.org/t/ssl-ca-cert-error-on-macos/31171/6">Discourse Post on SSL Errors with Nix on MacOS</a></li><li><a href="https://github.com/tomaszbawor/nix-configurations">My Nix Setup</a></li></ul><p>This should be it. If you encountered other issues leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af164f7ea4b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>