<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NixOS on Salar Rahmanian</title><link>https://www.softinio.com/tags/nixos/</link><description>Recent content in NixOS on Salar Rahmanian</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 03 May 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://www.softinio.com/tags/nixos/index.xml" rel="self" type="application/rss+xml"/><item><title>Using Stable And Unstable Nix/NixOS Channels Together</title><link>https://www.softinio.com/til/using-stable-and-unstable-nix-channels-together/</link><pubDate>Sat, 03 May 2025 00:00:00 +0000</pubDate><guid>https://www.softinio.com/til/using-stable-and-unstable-nix-channels-together/</guid><description>&lt;p&gt;For one of my servers that is running NixOS I have been using the stable channel for all packages. However I wanted for one package to use the version of the package that the unstable channel had and had to learn how to do it.&lt;/p&gt;
&lt;p&gt;I am using flakes and this is what I originally had as my input:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-nix" data-lang="nix"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixpkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;github:NixOS/nixpkgs/nixos-24.11&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I added the unstable channel as an input:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-nix" data-lang="nix"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixpkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;github:NixOS/nixpkgs/nixos-24.11&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixpkgs-unstable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- added this !&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;github:NixOS/nixpkgs/nixos-unstable&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I changed my output to make sure my system is configured with both channels as follows (see comments in code snippet for what I added):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-nix" data-lang="nix"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;outputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixpkgs&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixpkgs-unstable&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;--- added this&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;let&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;system&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;x86_64-linux&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Define the pkgs from both stable and unstable channels&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;pkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;nixpkgs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;inherit&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;unstablePkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;nixpkgs-unstable&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;inherit&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;in&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;nixosConfigurations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;myserver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nixpkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nixosSystem&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;inherit&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;modules&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="sr"&gt;./configuration.nix&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;specialArgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;inherit&lt;/span&gt; &lt;span class="n"&gt;pkgs&lt;/span&gt; &lt;span class="n"&gt;unstablePkgs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;--- inheriting both!&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now where ever I define a nix function I include both &lt;code&gt;pkgs&lt;/code&gt; and &lt;code&gt;unstablePkgs&lt;/code&gt; as arguments and am able to chose what package from which channel to use.&lt;/p&gt;
&lt;p&gt;For example when choosing what system packages I want to install:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-nix" data-lang="nix"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;environment&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;systemPackages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;pkgs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;eza&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;unstablePkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ripgrep&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy Days!&lt;/p&gt;</description></item><item><title>Elevating Python Development with Nix Package Manager</title><link>https://www.softinio.com/talks/elevating-python-development-with-nix/</link><pubDate>Sat, 14 Oct 2023 00:00:00 +0000</pubDate><guid>https://www.softinio.com/talks/elevating-python-development-with-nix/</guid><description>&lt;p&gt;

 &lt;picture&gt;
 &lt;source srcset="https://www.softinio.com/talks/elevating-python-development-with-nix/Elevating_Python_Development_with_Nix_Package_Manager_hu_76ac1cf2ae54af28.webp 780w, https://www.softinio.com/talks/elevating-python-development-with-nix/Elevating_Python_Development_with_Nix_Package_Manager_hu_faff51f85db337f4.webp 1280w"
 sizes="(max-width: 768px) calc(100vw - 2rem), (max-width: 830px) calc(100vw - 3rem), 780px"
 type="image/webp" /&gt;
 &lt;img src="https://www.softinio.com/talks/elevating-python-development-with-nix/Elevating_Python_Development_with_Nix_Package_Manager_hu_bc06c4a81beb8b85.png"
 alt="PyBay Food Truck Edition speaker card: Salar Rahmanian, &amp;ldquo;Elevating Python Development with Nix Package Manager&amp;rdquo;, San Francisco, Sun October 8"
 width="780" height="439"
 loading="eager" fetchpriority="high" /&gt;
 &lt;/picture&gt;
&lt;/p&gt;
&lt;p&gt;In October 2023 I had the great privilege to do a talk at PyBay 2023 in San Francisco, California.&lt;/p&gt;
&lt;h3 id="recording-of-my-talk"&gt;Recording of my talk&lt;a class="heading-anchor" href="#recording-of-my-talk" aria-label="Copy link to section: Recording of my talk" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;div class="yv"&gt;
 &lt;button type="button" class="yv-play" data-id="AJs_izrEBOA" data-title="YouTube video" aria-label="Play video: YouTube video"&gt;
 &lt;img src="https://i.ytimg.com/vi/AJs_izrEBOA/sddefault.jpg"
 srcset="https://i.ytimg.com/vi/AJs_izrEBOA/hqdefault.jpg 480w, https://i.ytimg.com/vi/AJs_izrEBOA/sddefault.jpg 640w"
 sizes="(max-width: 768px) calc(100vw - 2rem), (max-width: 830px) calc(100vw - 3rem), 780px"
 alt="" width="640" height="480" loading="lazy" /&gt;
 &lt;svg viewBox="0 0 68 48" aria-hidden="true"&gt;&lt;path d="M66.5 7.7a8.5 8.5 0 0 0-6-6C55.3.3 34 .3 34 .3s-21.3 0-26.5 1.4a8.5 8.5 0 0 0-6 6C.1 13 .1 24 .1 24s0 11 1.4 16.3a8.5 8.5 0 0 0 6 6C12.7 47.7 34 47.7 34 47.7s21.3 0 26.5-1.4a8.5 8.5 0 0 0 6-6C67.9 35 67.9 24 67.9 24s0-11-1.4-16.3z" fill="#f00"/&gt;&lt;path d="M45 24 27 14v20z" fill="#fff"/&gt;&lt;/svg&gt;
 &lt;/button&gt;
&lt;/div&gt;
&lt;p class="video-fallback"&gt;&lt;a href="https://www.youtube.com/watch?v=AJs_izrEBOA" target="_blank" rel="noopener"&gt;▶ Watch on YouTube&lt;/a&gt;&lt;/p&gt;

&lt;h3 id="slides"&gt;Slides&lt;a class="heading-anchor" href="#slides" aria-label="Copy link to section: Slides" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Slides for my talk can be found &lt;a href="https://github.com/softinio/talks/blob/master/PyBay2023/pybay2023_slides.pdf"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Streamline Your Development Workflow: Harnessing the Power of NixOS and Nix Package</title><link>https://www.softinio.com/talks/streamline-your-development-workflow/</link><pubDate>Sat, 14 Oct 2023 00:00:00 +0000</pubDate><guid>https://www.softinio.com/talks/streamline-your-development-workflow/</guid><description>&lt;p&gt;

 &lt;picture&gt;
 &lt;source srcset="https://www.softinio.com/talks/streamline-your-development-workflow/sbtb2023_hu_28f5e73fe65e1034.webp 780w, https://www.softinio.com/talks/streamline-your-development-workflow/sbtb2023_hu_5b8198fcf58d72d7.webp 1560w"
 sizes="(max-width: 768px) calc(100vw - 2rem), (max-width: 830px) calc(100vw - 3rem), 780px"
 type="image/webp" /&gt;
 &lt;img src="https://www.softinio.com/talks/streamline-your-development-workflow/sbtb2023_hu_195e56a20787cdbc.png"
 alt="Scale By The Bay speaker card: Salar Rahmanian, &amp;ldquo;Streamline Your Development Workflow: Harnessing the Power of NixOS and Nix Package Manager&amp;rdquo;"
 width="780" height="390"
 loading="eager" fetchpriority="high" /&gt;
 &lt;/picture&gt;
&lt;/p&gt;
&lt;p&gt;In November 2023 I had the great privilege to do a talk at &lt;a href="https://www.scale.bythebay.io/post/salar-rahmanian-streamline-your-development-workflow-harnessing-the-power-of-nixos-and-nix-package"&gt;Scale By The Bay 2023&lt;/a&gt; in San Francisco, California.&lt;/p&gt;
&lt;h3 id="recording-of-my-talk"&gt;Recording of my talk&lt;a class="heading-anchor" href="#recording-of-my-talk" aria-label="Copy link to section: Recording of my talk" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;div class="yv"&gt;
 &lt;button type="button" class="yv-play" data-id="Qv3Y23RjJa0" data-title="YouTube video" aria-label="Play video: YouTube video"&gt;
 &lt;img src="https://i.ytimg.com/vi/Qv3Y23RjJa0/sddefault.jpg"
 srcset="https://i.ytimg.com/vi/Qv3Y23RjJa0/hqdefault.jpg 480w, https://i.ytimg.com/vi/Qv3Y23RjJa0/sddefault.jpg 640w"
 sizes="(max-width: 768px) calc(100vw - 2rem), (max-width: 830px) calc(100vw - 3rem), 780px"
 alt="" width="640" height="480" loading="lazy" /&gt;
 &lt;svg viewBox="0 0 68 48" aria-hidden="true"&gt;&lt;path d="M66.5 7.7a8.5 8.5 0 0 0-6-6C55.3.3 34 .3 34 .3s-21.3 0-26.5 1.4a8.5 8.5 0 0 0-6 6C.1 13 .1 24 .1 24s0 11 1.4 16.3a8.5 8.5 0 0 0 6 6C12.7 47.7 34 47.7 34 47.7s21.3 0 26.5-1.4a8.5 8.5 0 0 0 6-6C67.9 35 67.9 24 67.9 24s0-11-1.4-16.3z" fill="#f00"/&gt;&lt;path d="M45 24 27 14v20z" fill="#fff"/&gt;&lt;/svg&gt;
 &lt;/button&gt;
&lt;/div&gt;
&lt;p class="video-fallback"&gt;&lt;a href="https://www.youtube.com/watch?v=Qv3Y23RjJa0" target="_blank" rel="noopener"&gt;▶ Watch on YouTube&lt;/a&gt;&lt;/p&gt;

&lt;h3 id="pre-conference-introduction-to-talk"&gt;Pre-Conference Introduction to talk&lt;a class="heading-anchor" href="#pre-conference-introduction-to-talk" aria-label="Copy link to section: Pre-Conference Introduction to talk" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;div class="yv"&gt;
 &lt;button type="button" class="yv-play" data-id="LVadoYGDvI8" data-title="YouTube video" aria-label="Play video: YouTube video"&gt;
 &lt;img src="https://i.ytimg.com/vi/LVadoYGDvI8/sddefault.jpg"
 srcset="https://i.ytimg.com/vi/LVadoYGDvI8/hqdefault.jpg 480w, https://i.ytimg.com/vi/LVadoYGDvI8/sddefault.jpg 640w"
 sizes="(max-width: 768px) calc(100vw - 2rem), (max-width: 830px) calc(100vw - 3rem), 780px"
 alt="" width="640" height="480" loading="lazy" /&gt;
 &lt;svg viewBox="0 0 68 48" aria-hidden="true"&gt;&lt;path d="M66.5 7.7a8.5 8.5 0 0 0-6-6C55.3.3 34 .3 34 .3s-21.3 0-26.5 1.4a8.5 8.5 0 0 0-6 6C.1 13 .1 24 .1 24s0 11 1.4 16.3a8.5 8.5 0 0 0 6 6C12.7 47.7 34 47.7 34 47.7s21.3 0 26.5-1.4a8.5 8.5 0 0 0 6-6C67.9 35 67.9 24 67.9 24s0-11-1.4-16.3z" fill="#f00"/&gt;&lt;path d="M45 24 27 14v20z" fill="#fff"/&gt;&lt;/svg&gt;
 &lt;/button&gt;
&lt;/div&gt;
&lt;p class="video-fallback"&gt;&lt;a href="https://www.youtube.com/watch?v=LVadoYGDvI8" target="_blank" rel="noopener"&gt;▶ Watch on YouTube&lt;/a&gt;&lt;/p&gt;

&lt;h3 id="post-conference-interview"&gt;Post Conference Interview&lt;a class="heading-anchor" href="#post-conference-interview" aria-label="Copy link to section: Post Conference Interview" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;div class="yv"&gt;
 &lt;button type="button" class="yv-play" data-id="B9wpkWdE368" data-title="YouTube video" aria-label="Play video: YouTube video"&gt;
 &lt;img src="https://i.ytimg.com/vi/B9wpkWdE368/sddefault.jpg"
 srcset="https://i.ytimg.com/vi/B9wpkWdE368/hqdefault.jpg 480w, https://i.ytimg.com/vi/B9wpkWdE368/sddefault.jpg 640w"
 sizes="(max-width: 768px) calc(100vw - 2rem), (max-width: 830px) calc(100vw - 3rem), 780px"
 alt="" width="640" height="480" loading="lazy" /&gt;
 &lt;svg viewBox="0 0 68 48" aria-hidden="true"&gt;&lt;path d="M66.5 7.7a8.5 8.5 0 0 0-6-6C55.3.3 34 .3 34 .3s-21.3 0-26.5 1.4a8.5 8.5 0 0 0-6 6C.1 13 .1 24 .1 24s0 11 1.4 16.3a8.5 8.5 0 0 0 6 6C12.7 47.7 34 47.7 34 47.7s21.3 0 26.5-1.4a8.5 8.5 0 0 0 6-6C67.9 35 67.9 24 67.9 24s0-11-1.4-16.3z" fill="#f00"/&gt;&lt;path d="M45 24 27 14v20z" fill="#fff"/&gt;&lt;/svg&gt;
 &lt;/button&gt;
&lt;/div&gt;
&lt;p class="video-fallback"&gt;&lt;a href="https://www.youtube.com/watch?v=B9wpkWdE368" target="_blank" rel="noopener"&gt;▶ Watch on YouTube&lt;/a&gt;&lt;/p&gt;

&lt;h3 id="slides"&gt;Slides&lt;a class="heading-anchor" href="#slides" aria-label="Copy link to section: Slides" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Slides for my talk can be found &lt;a href="https://github.com/softinio/talks/blob/master/SBTB2023/sbtb2023_slides.pdf"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Moving from Homebrew to Nix Package Manager</title><link>https://www.softinio.com/post/moving-from-homebrew-to-nix-package-manager/</link><pubDate>Sat, 16 Feb 2019 18:30:40 -0700</pubDate><guid>https://www.softinio.com/post/moving-from-homebrew-to-nix-package-manager/</guid><description>&lt;p&gt;As all my friends, colleagues and followers know I am very big on functional programming, so when I heard about nixOS and the nix package manager (A Purely Functional package manager) I really wanted to find out more about it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Quote from&lt;/strong&gt; &lt;a href="https://nixos.org/nix/"&gt;Nix&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. It provides atomic upgrades and rollbacks, side-by-side installation of multiple versions of a package, multi-user package management and easy setup of build environments.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Finally this weekend I got the chance to dig in, find out more about it and try my hand at it by moving from using &lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt; as my preferred choice for package management to Nix.&lt;/p&gt;
&lt;p&gt;Note that this not a detailed tutorial on Nix as I will leave that to the Nix documentation (see: &lt;a href="https://www.softinio.com/post/moving-from-homebrew-to-nix-package-manager/#references-and-recommended-resources"&gt;References and Recommended Resources&lt;/a&gt;), this is more of an account of how to get started with Nix fast to be productive quickly whilst you learn all about Nix.&lt;/p&gt;
&lt;h2 id="getting-started-with-nix"&gt;Getting started with Nix&lt;a class="heading-anchor" href="#getting-started-with-nix" aria-label="Copy link to section: Getting started with Nix" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The documentation for Nix is pretty detailed and extensive. Though I plan to read all of it, I wanted a quick overview of what I am getting myself into. To achieve that in timely fashion I read this fantastic overview &lt;a href="https://adelbertc.github.io/posts/2017-04-03-nix-journey.html"&gt;Adelblog - My journey into Nix&lt;/a&gt; by &lt;a href="https://twitter.com/adelbertchang"&gt;Adelbert Chang&lt;/a&gt;. This blog left me super excited to carry on.&lt;/p&gt;
&lt;h3 id="lets-install-nix"&gt;Lets Install Nix&lt;a class="heading-anchor" href="#lets-install-nix" aria-label="Copy link to section: Lets Install Nix" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Nix gives you two installation options: single user or multi-user. Even though I am the only user of my macbook I decided to go with the multiuser option so that Nix will be the defacto source of truth for everything on the whole laptop. Even if I never create another user for my laptop my software developer OCD is better satisfied by the way everything will be organized, setup and used on my laptop.&lt;/p&gt;
&lt;p&gt;To install open your terminal and run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sh &amp;lt;&lt;span class="o"&gt;(&lt;/span&gt;curl https://nixos.org/nix/install&lt;span class="o"&gt;)&lt;/span&gt; --daemon
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Follow the on screen instructions and you will have Nix Package manager installed on your macbook.&lt;/p&gt;
&lt;h3 id="installing-nix-darwin"&gt;Installing Nix Darwin&lt;a class="heading-anchor" href="#installing-nix-darwin" aria-label="Copy link to section: Installing Nix Darwin" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Nix Package manager is part of NixOS which is its own Linux based OS. With NixOS you can even configure your hardware and OS options using Nix . I was thinking to myself I wish I could do the same above just package management with MacOS. Luckily I found the Nix Darwin project &lt;a href="https://github.com/LnL7/nix-darwin"&gt;nix-darwin&lt;/a&gt;which is trying to achieve that for macbooks and macOS. So after a successful installation of Nix Package manager I set off installing Nix Darwin:&lt;/p&gt;
&lt;h4 id="backup-a-few-files-first"&gt;Backup a few files first&lt;a class="heading-anchor" href="#backup-a-few-files-first" aria-label="Copy link to section: Backup a few files first" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mv /etc/zprofile /etc/zprofile.orig
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.orig
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mv /etc/zshrc /etc/zshrc.orig
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="install-nix-darwin"&gt;Install Nix Darwin&lt;a class="heading-anchor" href="#install-nix-darwin" aria-label="Copy link to section: Install Nix Darwin" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./result/bin/darwin-installer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="moving-the-packages-i-have-with-homebrew-to-nix"&gt;Moving the packages I have with homebrew to Nix&lt;a class="heading-anchor" href="#moving-the-packages-i-have-with-homebrew-to-nix" aria-label="Copy link to section: Moving the packages I have with homebrew to Nix" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Once Nix and Nix-Darwin are installed you will have new configuration file here: &lt;code&gt;~/.nixpkgs/darwin-configuration.nix&lt;/code&gt;
I followed the following steps to move my packages across:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;run &lt;code&gt;brew list&lt;/code&gt; to get a list of what packages I have that was installed using homebrew&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;tip:&lt;/strong&gt; If you want to see what each package you have with homebrew depends on run this:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew list -1 &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; cask&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; -ne &lt;span class="s2"&gt;&amp;#34;\x1B[1;34m &lt;/span&gt;&lt;span class="nv"&gt;$cask&lt;/span&gt;&lt;span class="s2"&gt; \x1B[0m&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; brew uses &lt;span class="nv"&gt;$cask&lt;/span&gt; --installed &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;{printf(&amp;#34; %s &amp;#34;, $0)}&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Check if package you want to move across exists in Nix:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nix-env -qaP &lt;span class="p"&gt;|&lt;/span&gt; grep -i &amp;lt;packagename&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;alternatively you can visit: &lt;a href="https://nixos.org/nixos/packages.html#"&gt;Search NixOS packages&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add your package to &lt;code&gt;~/.nixpkgs/darwin-configuration.nix&lt;/code&gt; to the &lt;code&gt;environment.systemPackages&lt;/code&gt; list (its space separated list).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the nix packages you added to your config file by running:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;darwin-rebuild switch
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Remove the packages you successfully moved by running:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew uninstall &amp;lt;packagename&amp;gt; --force
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I started off by moving the packages one at a time , then in groups to completion. Last I run &lt;code&gt;brew cleanup&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You can take a look at my configuration here: &lt;a href="https://github.com/softinio/dotfiles/blob/master/nix/darwin-configuration.nix"&gt;Salar Rahmanian&amp;rsquo;s darwin-configuration.nix&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="useful-aliases-in-my-zsh-profile"&gt;Useful Aliases in my zsh profile&lt;a class="heading-anchor" href="#useful-aliases-in-my-zsh-profile" aria-label="Copy link to section: Useful Aliases in my zsh profile" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I added the following to my &lt;code&gt;.zshrc&lt;/code&gt; profile to make it easier for me to use
nix:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;alias nixre=&amp;#34;darwin-rebuild switch&amp;#34;
alias nixgc=&amp;#34;nix-collect-garbage -d&amp;#34;
alias nixq=&amp;#34;nix-env -qaP&amp;#34;
alias nixupgrade=&amp;#34;sudo -i sh -c &amp;#39;nix-channel --update &amp;amp;&amp;amp; nix-env -iA nixpkgs.nix &amp;amp;&amp;amp; launchctl remove org.nixos.nix-daemon &amp;amp;&amp;amp; launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist&amp;#39;&amp;#34;
alias nixup=&amp;#34;nix-env -u&amp;#34;
alias nixcfg=&amp;#34;nvim ~/.nixpkgs/darwin-configuration.nix&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="what-am-i-doing-next"&gt;What am I doing next?&lt;a class="heading-anchor" href="#what-am-i-doing-next" aria-label="Copy link to section: What am I doing next?" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This certainly has got me started with Nix and have me excited to use it more as much as possible so next I am looking at:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Moving my neovim/vim configuration to using Nix.&lt;/li&gt;
&lt;li&gt;Learn and move my development workflow to using Nix shell. I currently develop using Scala, Haskell and Python I would love to hear from everyone on what tools you are using and what your workflow is&lt;/li&gt;
&lt;li&gt;Create some nix packages for anything I notice missing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course I will share all my learnings here on my blog so keep an eye on my blog or follow me on Twitter.&lt;/p&gt;
&lt;h2 id="references-and-recommended-resources"&gt;References and Recommended Resources&lt;a class="heading-anchor" href="#references-and-recommended-resources" aria-label="Copy link to section: References and Recommended Resources" title="Copy link to this section"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nixos.org/nix/manual/"&gt;Nix package manager manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/LnL7/nix-darwin"&gt;nix-darwin: nix modules for darwin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nixos.org/nixos/packages.html#"&gt;Search NixOS packages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://howoldis.herokuapp.com/"&gt;How up to date are NixOS channels?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://adelbertc.github.io/posts/2017-04-03-nix-journey.html"&gt;Adelblog - My journey into Nix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nixos.org/nixos/nix-pills/"&gt;Nix Pills&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/softinio/dotfiles"&gt;Salar Rahmanian dotfiles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>