From 3fb217a613f0bef230e965da27004d802ad0743d Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Mon, 3 Jan 2022 11:38:01 +0100 Subject: [PATCH] Switch to pipewire --- defaults/desktop/hardware.nix | 43 ++++++++++++++++---- defaults/user-configuration/fhauser/sway.nix | 2 + 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/defaults/desktop/hardware.nix b/defaults/desktop/hardware.nix index 4f8ee1d..942dff8 100644 --- a/defaults/desktop/hardware.nix +++ b/defaults/desktop/hardware.nix @@ -8,15 +8,42 @@ sound.enable = true; nixpkgs.config.pulseaudio = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + media-session.enable = true; + media-session.config.bluez-monitor.rules = [ + { + # Matches all cards + matches = [{ "device.name" = "~bluez_card.*"; }]; + actions = { + "update-props" = { + "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; + # mSBC is not expected to work on all headset + adapter combinations. + "bluez5.msbc-support" = true; + # SBC-XQ is not expected to work on all headset + adapter combinations. + "bluez5.sbc-xq-support" = true; + }; + }; + } + { + matches = [ + # Matches all sources + { + "node.name" = "~bluez_input.*"; + } + # Matches all outputs + { "node.name" = "~bluez_output.*"; } + ]; + actions = { "node.pause-on-idle" = false; }; + } + ]; + }; + security.rtkit.enable = true; + hardware = { - pulseaudio = { - enable = true; - extraModules = with pkgs; [ pulseaudio-modules-bt ]; - package = pkgs.pulseaudioFull; - extraConfig = '' - load-module module-switch-on-connect - ''; - }; + pulseaudio.enable = lib.mkForce false; opengl.enable = true; acpilight.enable = true; bluetooth = { diff --git a/defaults/user-configuration/fhauser/sway.nix b/defaults/user-configuration/fhauser/sway.nix index 4f9964e..7d5df35 100644 --- a/defaults/user-configuration/fhauser/sway.nix +++ b/defaults/user-configuration/fhauser/sway.nix @@ -2,6 +2,8 @@ # environment.systemPackages = with pkgs; [ polkit_gnome ]; #TODO: Needed? programs.sway.enable = true; + xdg.portal.wlr.enable = true; + services.gnome.gnome-remote-desktop.enable = true; #environment.systemPackages = with pkgs; [ pipewire ]; #systemd.user.services.pipewire.environment.XDG_CURRENT_DESKTOP = "sway";