<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Georg Krause - NixOS, Ardour, Audio</title><link href="https://www.georg-krause.net/" rel="alternate"/><link href="https://www.georg-krause.net/feeds/nixos-ardour-audio.atom.xml" rel="self"/><id>https://www.georg-krause.net/</id><updated>2026-10-01T00:00:00+02:00</updated><subtitle>coding - music - building stuff</subtitle><entry><title>Ardour on NixOS with Wayland</title><link href="https://www.georg-krause.net/ardour-on-nixos-with-wayland.html" rel="alternate"/><published>2026-10-01T00:00:00+02:00</published><updated>2026-10-01T00:00:00+02:00</updated><author><name>Georg Krause</name></author><id>tag:www.georg-krause.net,2026-10-01:/ardour-on-nixos-with-wayland.html</id><summary type="html">&lt;p&gt;Last year I had to take over the maintenance of about 30 NixOS servers at work.
To make it easier for me to handle this and to force me learning more about the
distribution, I switched the operating system of my work device to NixOS as
well.&lt;/p&gt;
&lt;p&gt;After some weeks …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Last year I had to take over the maintenance of about 30 NixOS servers at work.
To make it easier for me to handle this and to force me learning more about the
distribution, I switched the operating system of my work device to NixOS as
well.&lt;/p&gt;
&lt;p&gt;After some weeks I loved it so much, I radically migrated all the systems I
could to nixos as well. Its just way too great to test some cli tool with the
temporary nix shell that just goes away if I don't like the tool. Its way too
great to jump into whatever project and have a well defined environment
available with the specific tools installed. Its way too great to have all this
without the overhead a container introduces...&lt;/p&gt;
&lt;p&gt;But back to our topic, since I make some music, I occasionally need
&lt;a href="https://ardour.org"&gt;Ardour&lt;/a&gt;. Its my default digital audio workstation, its
great, stable, does not change the interface every month and is linux native.&lt;/p&gt;
&lt;p&gt;However, I had some issues using it on NixOS. The interface was freezing
whenever I tried to open it. It seemed super random to me. Later I learned it
only happens if the cursor is moved at the wrong time. So I could work around
the freeze, but it wasn't nice.&lt;/p&gt;
&lt;p&gt;After some investigation I learned that wayland is the issue. Ardours interface
is implemented in GTK2, which does not and never will support wayland. So the
solution is &lt;code&gt;xwayland&lt;/code&gt; or similar. I had it installed, but it did not work out
of the box. Maybe this is because my &lt;code&gt;.zshrc&lt;/code&gt; sets &lt;code&gt;GDK_BACKEND=wayland&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;However, NixOS provides a cool workaround for issues like this: A wrapper. We
basically mirror the Ardour package using symlinks but replace the binary with a
wrapper script that calls the binary after applying some magic:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  environment&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="ss"&gt;systemPackages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="c1"&gt;# Ardour is a GTK2 app with no Wayland backend. Since GDK_BACKEND=wayland&lt;/span&gt;
    &lt;span class="c1"&gt;# is set globally, force x11 (XWayland) here so its GUI reliably shows up.&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;pkgs&lt;span class="o"&gt;.&lt;/span&gt;symlinkJoin &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="ss"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ardour"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="ss"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; pkgs&lt;span class="o"&gt;.&lt;/span&gt;ardour &lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="ss"&gt;nativeBuildInputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; pkgs&lt;span class="o"&gt;.&lt;/span&gt;makeWrapper &lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="ss"&gt;postBuild&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s s-Multiline"&gt;''&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;        wrapProgram $out/bin/ardour9 \&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;          --set GDK_BACKEND x11 \&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;      ''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now I was able to use Ardour with alsa, which is fine. However, I prefer
pipewire/jack because I can still use normal desktop audio even if Ardour is
running. Ardour can use Pipewire as audio backend if the jack-bridge is
running. Thats easy:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    services&lt;span class="o"&gt;.&lt;/span&gt;pipewire&lt;span class="o"&gt;.&lt;/span&gt;jack&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="ss"&gt;enable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This way Ardour can talk to Pipewire as if it was a Jack server. In theory. But
because we are running NixOS and Ardour is built against normal jack it wouldn't
load pipewires &lt;code&gt;libjack.so&lt;/code&gt; unless we tell it to do so. Luckily the wrapper is
already set up and I can just add a tiny line of code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  environment&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="ss"&gt;systemPackages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="c1"&gt;# Ardour is a GTK2 app with no Wayland backend. Since GDK_BACKEND=wayland&lt;/span&gt;
    &lt;span class="c1"&gt;# is set globally, force x11 (XWayland) here so its GUI reliably shows up.&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;pkgs&lt;span class="o"&gt;.&lt;/span&gt;symlinkJoin &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="ss"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ardour"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="ss"&gt;paths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; pkgs&lt;span class="o"&gt;.&lt;/span&gt;ardour &lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="ss"&gt;nativeBuildInputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; pkgs&lt;span class="o"&gt;.&lt;/span&gt;makeWrapper &lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="ss"&gt;postBuild&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s s-Multiline"&gt;''&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;        wrapProgram $out/bin/ardour9 \&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;          --set GDK_BACKEND x11 \&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;          --prefix LD_LIBRARY_PATH : &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;pkgs&lt;span class="o"&gt;.&lt;/span&gt;pipewire&lt;span class="o"&gt;.&lt;/span&gt;jack&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s s-Multiline"&gt;/lib&lt;/span&gt;
&lt;span class="s s-Multiline"&gt;      ''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now Ardour works well enough for now on NixOS and Sway. I am sure I am going to
extend my module over time.&lt;/p&gt;</content><category term="NixOS, Ardour, Audio"/></entry></feed>