From 7ce2abb122aec3a13ab31e1d31efeb9072654bad Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Sat, 3 Aug 2024 23:29:29 +0200 Subject: [PATCH] hosts/main: move wireplumber configuration to git --- hosts/main/default.nix | 12 ++++++++++ hosts/main/wireplumber/51-digital-output.conf | 10 +++++++++ hosts/main/wireplumber/51-hdmi-otuput.conf | 10 +++++++++ .../51-razerHeadphones-device.conf | 11 ++++++++++ .../wireplumber/51-razerHeadphones-input.conf | 10 +++++++++ .../51-razerHeadphones-output.conf | 22 +++++++++++++++++++ 6 files changed, 75 insertions(+) create mode 100644 hosts/main/wireplumber/51-digital-output.conf create mode 100644 hosts/main/wireplumber/51-hdmi-otuput.conf create mode 100644 hosts/main/wireplumber/51-razerHeadphones-device.conf create mode 100644 hosts/main/wireplumber/51-razerHeadphones-input.conf create mode 100644 hosts/main/wireplumber/51-razerHeadphones-output.conf diff --git a/hosts/main/default.nix b/hosts/main/default.nix index 8faf041..d35b5bc 100644 --- a/hosts/main/default.nix +++ b/hosts/main/default.nix @@ -45,6 +45,18 @@ ]; }; + services.pipewire.wireplumber.configPackages = [( + pkgs.stdenvNoCC.mkDerivation { + name = "wireplumber-config"; + src = ./wireplumber; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out/share/wireplumber/wireplumber.conf.d + cp -r $src/* $out/share/wireplumber/wireplumber.conf.d + ''; + } + )]; + services.printing.startWhenNeeded = false; system.stateVersion = "23.05"; diff --git a/hosts/main/wireplumber/51-digital-output.conf b/hosts/main/wireplumber/51-digital-output.conf new file mode 100644 index 0000000..57bdff3 --- /dev/null +++ b/hosts/main/wireplumber/51-digital-output.conf @@ -0,0 +1,10 @@ +monitor.alsa.rules = [{ + matches = [{ + node.name = "alsa_output.pci-0000_00_1f.3.iec958-stereo" + }] + actions = { + update-props = { + node.description = "Digital Output" + } + } +}] diff --git a/hosts/main/wireplumber/51-hdmi-otuput.conf b/hosts/main/wireplumber/51-hdmi-otuput.conf new file mode 100644 index 0000000..265b78a --- /dev/null +++ b/hosts/main/wireplumber/51-hdmi-otuput.conf @@ -0,0 +1,10 @@ +monitor.alsa.rules = [{ + matches = [{ + node.name = "alsa_output.pci-0000_01_00.1.hdmi-stereo" + }] + actions = { + update-props = { + node.description = "Monitor speakers" + } + } +}] diff --git a/hosts/main/wireplumber/51-razerHeadphones-device.conf b/hosts/main/wireplumber/51-razerHeadphones-device.conf new file mode 100644 index 0000000..b159a49 --- /dev/null +++ b/hosts/main/wireplumber/51-razerHeadphones-device.conf @@ -0,0 +1,11 @@ +monitor.alsa.rules = [{ + matches = [{ + device.name = "alsa_card.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00" + }] + actions = { + update-props = { + device.description = "Headphones" + device.profile = "Pro Audio" + } + } +}] diff --git a/hosts/main/wireplumber/51-razerHeadphones-input.conf b/hosts/main/wireplumber/51-razerHeadphones-input.conf new file mode 100644 index 0000000..c24a599 --- /dev/null +++ b/hosts/main/wireplumber/51-razerHeadphones-input.conf @@ -0,0 +1,10 @@ +monitor.alsa.rules = [{ + matches = [{ + node.name = "alsa_input.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-input-0" + }] + actions = { + update-props = { + node.description = "Headphones" + } + } +}] diff --git a/hosts/main/wireplumber/51-razerHeadphones-output.conf b/hosts/main/wireplumber/51-razerHeadphones-output.conf new file mode 100644 index 0000000..11cb43e --- /dev/null +++ b/hosts/main/wireplumber/51-razerHeadphones-output.conf @@ -0,0 +1,22 @@ +monitor.alsa.rules = [ + { + matches = [{ + node.name = "alsa_output.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-output-0" + }] + actions = { + update-props = { + node.description = "Headphones (Chat)" + } + } + } + { + matches = [{ + node.name = "alsa_output.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-output-1" + }] + actions = { + update-props = { + node.description = "Headphones (Game)" + } + } + } +]