From cf34ead8ce3f653d276175b3255ffb5717cb1c48 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Sat, 14 Aug 2021 12:18:09 +0200 Subject: [PATCH] pipewire --- nixos/roles/graphical.nix | 5 ----- nixos/roles/workstation.nix | 39 +++++++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/nixos/roles/graphical.nix b/nixos/roles/graphical.nix index ff59639..35e6d7a 100644 --- a/nixos/roles/graphical.nix +++ b/nixos/roles/graphical.nix @@ -11,11 +11,6 @@ in { config, lib, pkgs, ... }: { enable = true; driSupport32Bit = config.yorick.support32bit; }; - sound.enable = true; - hardware.pulseaudio = { - enable = true; - support32Bit = config.yorick.support32bit; - }; users.users.yorick.extraGroups = [ "video" ]; # fix backlight permissions services.udev.extraRules = '' diff --git a/nixos/roles/workstation.nix b/nixos/roles/workstation.nix index 91e2cbc..9decbbc 100644 --- a/nixos/roles/workstation.nix +++ b/nixos/roles/workstation.nix @@ -36,8 +36,6 @@ in { services.pcscd.enable = true; #environment.systemPackages = [pkgs.yubikey-manager]; fonts.fonts = [ pkgs.emojione ]; - # bluetooth headphones - hardware.pulseaudio.package = pkgs.pulseaudioFull; programs.wireshark.enable = true; nix = { gc.automatic = pkgs.lib.mkOverride 30 false; @@ -75,9 +73,6 @@ in { SUBSYSTEM=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="5bf0", MODE="0664", GROUP="dialout" ''; - # LDAC: - hardware.pulseaudio.extraModules = [ pkgs.pulseaudio-modules-bt ]; - # picoscope #users.users.yorick.extraGroups = ["pico"]; services.udev.packages = [ @@ -99,7 +94,39 @@ in { yorick.lumi-vpn.enable = true; - services.pipewire.enable = true; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; # todo: support32bit? + pulse.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; + }; + } + ]; + }; xdg.portal = { enable = true; extraPortals = with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ];