From 8be74baad009dde11fd70b0d0e9d390331c2adbe Mon Sep 17 00:00:00 2001 From: queer-bird <45827800+queer-bird@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:59:10 -0800 Subject: [PATCH] Fix audio interference in headphone jack on Thinkpad x1 Nano Gen 1 --- lenovo/thinkpad/x1-nano/gen1/default.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lenovo/thinkpad/x1-nano/gen1/default.nix b/lenovo/thinkpad/x1-nano/gen1/default.nix index 989e204..1cc17b1 100644 --- a/lenovo/thinkpad/x1-nano/gen1/default.nix +++ b/lenovo/thinkpad/x1-nano/gen1/default.nix @@ -1,3 +1,17 @@ -{ ... }: { +{ pkgs, ... }: imports = [ ../. ]; + + environment.systemPackages = with pkgs; [ + alsa-utils + ]; + + systemd.services.x1-fix = { + description = "Use alsa-utils to fix sound interference on Thinkpad x1 Nano"; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.alsa-tools}/bin/hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0"; + Restart = "on-failure"; + }; + wantedBy = [ "default.target" ]; + }; }