From ba181a3bdd64f980fbd32bf3690235117b5ad2e1 Mon Sep 17 00:00:00 2001 From: jmug Date: Wed, 18 Nov 2026 23:41:29 -0800 Subject: [PATCH] [ubuntu] Audio fix on X1 Carbon Gen14. --- hosts/ubuntu/home.nix | 37 +++++++++++++++++++++++++++++++++++++ ubuntu/apt-packages.txt | 3 +++ 2 files changed, 40 insertions(+) diff --git a/hosts/ubuntu/home.nix b/hosts/ubuntu/home.nix index dd823b0..1a2e352 100644 --- a/hosts/ubuntu/home.nix +++ b/hosts/ubuntu/home.nix @@ -146,6 +146,43 @@ in { syssw = "${homeDirectory}/nixos/ubuntu/bootstrap.sh"; }; + # Friendlier names for the built-in SoundWire audio (Intel SOF "sof-soundwire" + # card), which otherwise shows up as "sof-soundwire Speaker" etc. + # TODO: X1 Carbon Gen 14 specific (harmless elsewhere: rules only match + # sof_sdw nodes). Move to a per-machine module when another host lands. + xdg.configFile."wireplumber/wireplumber.conf.d/51-builtin-audio-names.conf".text = '' + monitor.alsa.rules = [ + { + matches = [ { device.name = "~alsa_card.*sof_sdw.*" } ] + actions = { update-props = { device.description = "Built-in Audio", device.nick = "Built-in Audio" } } + } + { + matches = [ { node.name = "~alsa_output.*sof_sdw.*Speaker.*" } ] + actions = { update-props = { node.description = "Speakers" } } + } + { + matches = [ { node.name = "~alsa_output.*sof_sdw.*Headphones.*" } ] + actions = { update-props = { node.description = "Headphones" } } + } + { + matches = [ { node.name = "~alsa_input.*sof_sdw.*Mic.*" } ] + actions = { update-props = { node.description = "Internal Microphones" } } + } + { + matches = [ { node.name = "~alsa_output.*sof_sdw.*HDMI1.*" } ] + actions = { update-props = { node.description = "HDMI / DisplayPort 1" } } + } + { + matches = [ { node.name = "~alsa_output.*sof_sdw.*HDMI2.*" } ] + actions = { update-props = { node.description = "HDMI / DisplayPort 2" } } + } + { + matches = [ { node.name = "~alsa_output.*sof_sdw.*HDMI3.*" } ] + actions = { update-props = { node.description = "HDMI / DisplayPort 3" } } + } + ] + ''; + # mise is installed by `ubuntu/bootstrap.sh tools`. programs.zsh.initContent = '' if [ -x "$HOME/.local/bin/mise" ]; then diff --git a/ubuntu/apt-packages.txt b/ubuntu/apt-packages.txt index 4237e72..d061270 100644 --- a/ubuntu/apt-packages.txt +++ b/ubuntu/apt-packages.txt @@ -23,3 +23,6 @@ clang clangd cmake pkg-config + +# Out-of-tree kernel modules: +dkms