<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>operatingsystems &amp;mdash; Arjen Wiersma</title>
    <link>https://www.arjenwiersma.nl/tag:operatingsystems</link>
    <description>A blog on Emacs, self-hosting, programming and other nerdy things</description>
    <pubDate>Mon, 04 May 2026 14:37:25 +0000</pubDate>
    <item>
      <title>The joy of NixOS</title>
      <link>https://www.arjenwiersma.nl/the-joy-of-nixos</link>
      <description>&lt;![CDATA[&#xA;In July 2023, I installed NixOS as my daily operating system. NixOS is a Linux distribution that emphasizes a declarative approach to system management. This means you define your desired operating system configuration in a file (e.g., KDE with Emacs 30 and Firefox), and the Nix package manager uses that file to create your OS. Every change generates a new version, allowing you to revert to a previous version if anything goes wrong.&#xA;&#xA;Prior to NixOS, I used various Ubuntu and Debian-based distributions, with POP_OS! being my favorite. I often encountered package conflicts or misconfigurations during updates. NixOS has resolved these issues for me.&#xA;&#xA;Since switching in 2023, I&#39;ve experienced zero problems with upgrades or stability. While experimenting with different desktop environments posed some challenges, the ability to reboot into a prior OS version (or &#34;generation&#34;) has provided a safety net I didn&#39;t realize I needed.&#xA;&#xA;My NixOS configuration primarily revolves around three files: /etc/nixos/configuration.nix, created during installation and tailored to my chosen desktop (currently KDE for my work laptop); /etc/nixos/shared.nix, which contains shared services and settings for my laptop, desktop, and work laptop, encompassing everything from Bluetooth to sound configurations. This setup ensures I have a consistent and functional desktop environment across all my systems.&#xA;&#xA;The last file I manage is ~/.config/home-manager/home.nix, which contains all the programs I want, such as Emacs, wl-clipboard, and Firefox, along with user services like the Emacs daemon. Essentially, I only need to edit home.nix as a user and run home-manager switch to deploy new programs on my system. &#xA;&#xA;During the biannual update cycle in May and November, I update the nixos and home-manager channels and run sudo nixos-rebuild switch --upgrade for a system upgrade. While there can be occasional breaking changes, Nix alerts me to these. I can easily run upgrades before important meetings, confident it will work smoothly, and if issues arise, I can simply reboot into a previous generation.&#xA;&#xA;It&#39;s a delightful experience! Although there&#39;s a learning curve for newcomers, I highly recommend investing time in a VM to grasp the basics; it&#39;s well worth it over time.&#xA;&#xA;In my home.nix, I include only the essential programs I use regularly, like Emacs. For my development projects, I rely on nix-direnv, which manages project-specific dependencies, such as compilers. Each {{ backlink &#34;clojure&#34; &#34;Clojure&#34;}} project, for instance, contains a flake.nix file in the root that specifies its dependencies.&#xA;&#xA;{&#xA;  description = &#34;A basic flake with a shell&#34;;&#xA;  inputs.nixpkgs.url = &#34;github:NixOS/nixpkgs/nixpkgs-unstable&#34;;&#xA;  inputs.flake-utils.url = &#34;github:numtide/flake-utils&#34;;&#xA;&#xA;  outputs = { nixpkgs, flake-utils, ... }:&#xA;    flake-utils.lib.eachDefaultSystem (system:&#xA;      let&#xA;        pkgs = nixpkgs.legacyPackages.${system};&#xA;      in&#xA;      {&#xA;        devShells.default = pkgs.mkShell {&#xA;          packages = [ &#xA;            pkgs.clojure&#xA;            pkgs.clojure-lsp&#xA;            pkgs.clj-kondo&#xA;            pkgs.cljfmt&#xA;            pkgs.nodejs&#xA;            pkgs.jdk23&#xA;            pkgs.unzip&#xA;          ];&#xA;        };&#xA;      });&#xA;}&#xA;&#xA;The packages list above establishes a complete development environment for users. When I share my project with others using NixOS (nix-direnv), it seamlessly works for them, as it has no external dependencies. For my {{ backlink &#34;rust&#34; &#34;Rust&#34;}} projects, like hed, I utilize a similar flake.nix specific to that project. Moving it to a new machine and entering the directory automatically builds a new (complete) development environment via nix-direnv, allowing me to dive right in. 🏝️&#xA;&#xA;#linux #nixos #programming #operatingSystems]]&gt;</description>
      <content:encoded><![CDATA[<p>In July 2023, I installed NixOS as my daily operating system. NixOS is a Linux distribution that emphasizes a declarative approach to system management. This means you define your desired operating system configuration in a file (e.g., KDE with Emacs 30 and Firefox), and the Nix package manager uses that file to create your OS. Every change generates a new version, allowing you to revert to a previous version if anything goes wrong.</p>

<p>Prior to NixOS, I used various Ubuntu and Debian-based distributions, with POP_OS! being my favorite. I often encountered package conflicts or misconfigurations during updates. NixOS has resolved these issues for me.</p>

<p>Since switching in 2023, I&#39;ve experienced zero problems with upgrades or stability. While experimenting with different desktop environments posed some challenges, the ability to reboot into a prior OS version (or “generation”) has provided a safety net I didn&#39;t realize I needed.</p>

<p>My NixOS configuration primarily revolves around three files: <code>/etc/nixos/configuration.nix</code>, created during installation and tailored to my chosen desktop (currently KDE for my work laptop); <code>/etc/nixos/shared.nix</code>, which contains shared services and settings for my laptop, desktop, and work laptop, encompassing everything from Bluetooth to sound configurations. This setup ensures I have a consistent and functional desktop environment across all my systems.</p>

<p>The last file I manage is <code>~/.config/home-manager/home.nix</code>, which contains all the programs I want, such as Emacs, wl-clipboard, and Firefox, along with user services like the Emacs daemon. Essentially, I only need to edit <code>home.nix</code> as a user and run <code>home-manager switch</code> to deploy new programs on my system.</p>

<p>During the biannual update cycle in May and November, I update the <code>nixos</code> and <code>home-manager</code> channels and run <code>sudo nixos-rebuild switch --upgrade</code> for a system upgrade. While there can be occasional breaking changes, Nix alerts me to these. I can easily run upgrades before important meetings, confident it will work smoothly, and if issues arise, I can simply reboot into a previous generation.</p>

<p>It&#39;s a delightful experience! Although there&#39;s a learning curve for newcomers, I highly recommend investing time in a VM to grasp the basics; it&#39;s well worth it over time.</p>

<p>In my <code>home.nix</code>, I include only the essential programs I use regularly, like Emacs. For my development projects, I rely on <a href="https://github.com/nix-community/nix-direnv">nix-direnv</a>, which manages project-specific dependencies, such as compilers. Each {{&lt; backlink “clojure” “Clojure”&gt;}} project, for instance, contains a <code>flake.nix</code> file in the root that specifies its dependencies.</p>

<pre><code class="language-nix">{
  description = &#34;A basic flake with a shell&#34;;
  inputs.nixpkgs.url = &#34;github:NixOS/nixpkgs/nixpkgs-unstable&#34;;
  inputs.flake-utils.url = &#34;github:numtide/flake-utils&#34;;

  outputs = { nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      {
        devShells.default = pkgs.mkShell {
          packages = [ 
            pkgs.clojure
            pkgs.clojure-lsp
            pkgs.clj-kondo
            pkgs.cljfmt
            pkgs.nodejs
            pkgs.jdk23
            pkgs.unzip
          ];
        };
      });
}
</code></pre>

<p>The <code>packages</code> list above establishes a complete development environment for users. When I share my project with others using NixOS (nix-direnv), it seamlessly works for them, as it has no external dependencies. For my {{&lt; backlink “rust” “Rust”&gt;}} projects, like <a href="https://github.com/credmp/hed/blob/main/flake.nix">hed</a>, I utilize a similar <code>flake.nix</code> specific to that project. Moving it to a new machine and entering the directory automatically builds a new (complete) development environment via <code>nix-direnv</code>, allowing me to dive right in. 🏝️</p>

<p><a href="https://www.arjenwiersma.nl/tag:linux" class="hashtag"><span>#</span><span class="p-category">linux</span></a> <a href="https://www.arjenwiersma.nl/tag:nixos" class="hashtag"><span>#</span><span class="p-category">nixos</span></a> <a href="https://www.arjenwiersma.nl/tag:programming" class="hashtag"><span>#</span><span class="p-category">programming</span></a> <a href="https://www.arjenwiersma.nl/tag:operatingSystems" class="hashtag"><span>#</span><span class="p-category">operatingSystems</span></a></p>
]]></content:encoded>
      <guid>https://www.arjenwiersma.nl/the-joy-of-nixos</guid>
      <pubDate>Sat, 11 Jan 2025 13:31:20 +0000</pubDate>
    </item>
  </channel>
</rss>