From 2cc97bf138254e120efac72974bc2fe6eac4d35a Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sun, 3 Dec 2023 14:01:10 +0100 Subject: [PATCH] Switch to pipewire --- machines/common.nix | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/machines/common.nix b/machines/common.nix index 2494523..9f98347 100644 --- a/machines/common.nix +++ b/machines/common.nix @@ -26,17 +26,17 @@ inputs: i18n.defaultLocale = "en_GB.UTF-8"; time.timeZone = "Europe/Berlin"; - sound.enable = true; + #sound.enable = true; hardware = { # TODO: remove enableAllFirmware = true; - pulseaudio = { + #pulseaudio = { # TODO: pipewire - enable = true; + #enable = true; # stop mumble from muting other processes - extraConfig = "unload-module module-role-cork"; - }; + #extraConfig = "unload-module module-role-cork"; + #}; opengl = { enable = true; # driSupport = true; @@ -66,9 +66,13 @@ inputs: # Enable CUPS to print documents. printing.enable = true; + pipewire = { - enable = false; + enable = true; + alsa.enable = true; + alsa.support32Bit = true; pulse.enable = true; + wireplumber.enable = true; }; # required for nextcloud gnome.gnome-keyring.enable = true; @@ -110,6 +114,18 @@ inputs: "L+ /lib64/ld-linux-x86-64.so.2 - - - - ${pkgs.glibc}/lib64/ld-linux-x86-64.so.2" ]; + # pipewire bluetooth config (https://nixos.wiki/wiki/PipeWire#Bluetooth_Configuration) + environment.etc = { + "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + ''; + }; + environment.systemPackages = with pkgs; [ alacritty arandr @@ -205,6 +221,9 @@ inputs: sudo = { package = pkgs.sudo.override { withInsults = true; }; }; + + # rtkit is optional but recommended for pipewire + rtkit.enable = true; }; }