From 03da5e70c44c12ac8f560aa45b443972b73701a8 Mon Sep 17 00:00:00 2001 From: Bad Date: Mon, 30 Aug 2021 02:09:15 +0200 Subject: [PATCH] Switch to pipewire --- profiles/pipewire/default.nix | 46 +++++++++++++++++++++++++++++++++++ profiles/pulse/default.nix | 9 +++++++ profiles/sway/default.nix | 8 ------ suites/default.nix | 2 +- 4 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 profiles/pipewire/default.nix create mode 100644 profiles/pulse/default.nix diff --git a/profiles/pipewire/default.nix b/profiles/pipewire/default.nix new file mode 100644 index 0000000..7e15f4f --- /dev/null +++ b/profiles/pipewire/default.nix @@ -0,0 +1,46 @@ +{...}: +{ + +# rtkit is optional but recommended +security.rtkit.enable = true; +services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + media-session.enable = true; + + #bluetooth config + 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; + }; + } + ]; +}; +} diff --git a/profiles/pulse/default.nix b/profiles/pulse/default.nix new file mode 100644 index 0000000..4405c25 --- /dev/null +++ b/profiles/pulse/default.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: + { + sound.enable = true; + hardware.pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + extraModules = [ pkgs.pulseaudio-modules-bt ]; + }; + diff --git a/profiles/sway/default.nix b/profiles/sway/default.nix index 1d701bd..1dfb11e 100644 --- a/profiles/sway/default.nix +++ b/profiles/sway/default.nix @@ -15,14 +15,6 @@ ]; }; - sound.enable = true; - - hardware.pulseaudio = { - enable = true; - package = pkgs.pulseaudioFull; - extraModules = [ pkgs.pulseaudio-modules-bt ]; - }; - hardware.opengl = { enable = true; driSupport = true; diff --git a/suites/default.nix b/suites/default.nix index 993ec99..25e3e19 100644 --- a/suites/default.nix +++ b/suites/default.nix @@ -1,7 +1,7 @@ { profiles, ... }: with profiles; rec { base = [ users.root core dnscrypt ]; - workstation = base ++ [ sway develop game profiles.workstation ssh flatpak torrents pwn tor rust virtualization java ]; + workstation = base ++ [ sway develop game profiles.workstation ssh flatpak torrents pwn tor rust virtualization java pipewire ]; desktop = workstation ++ [ users.mae-desk amd three_dee androidev ]; lap = workstation ++ [ users.mae-lap laptop bluetooth print networkmanager androidev ]; }