From b3863bfc2228daef2d8de7afa251283f4e4cc5fb Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Mon, 29 May 2023 20:27:56 +0200 Subject: [PATCH] maybe fix pipewire --- nixos/components/gui/home-manager/i3.nix | 2 +- nixos/machines/cream/configuration.nix | 4 +++ nixos/machines/cream/pipewire.nix | 35 ++++++++++++++++++++++++ nixos/modules/system/audio.nix | 14 +--------- 4 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 nixos/machines/cream/pipewire.nix diff --git a/nixos/components/gui/home-manager/i3.nix b/nixos/components/gui/home-manager/i3.nix index bfcbda5..cc2da7b 100644 --- a/nixos/components/gui/home-manager/i3.nix +++ b/nixos/components/gui/home-manager/i3.nix @@ -135,7 +135,7 @@ in [ { command = "${pkgs.albert}/bin/albert"; always = true; } { command = toString backgroundCommand; always = true; } - #{ command = "${pkgs.flameshot}/bin/flameshot"; always = true; } + { command = "${pkgs.wireplumber}/bin/wireplumber"; always = true; } # { command = "systemctl --user restart polybar"; always = true; notification = false; } ]; fonts = { diff --git a/nixos/machines/cream/configuration.nix b/nixos/machines/cream/configuration.nix index 718046c..c356d8a 100644 --- a/nixos/machines/cream/configuration.nix +++ b/nixos/machines/cream/configuration.nix @@ -21,8 +21,12 @@ ./borg.nix ./trilium.nix + # todo move to component + ./pipewire.nix + ]; + users.users.mainUser.extraGroups = [ "pipewire" ]; components.gui.enable = true; components.terminal.enable = true; diff --git a/nixos/machines/cream/pipewire.nix b/nixos/machines/cream/pipewire.nix new file mode 100644 index 0000000..da94086 --- /dev/null +++ b/nixos/machines/cream/pipewire.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: +# TODO test `alsactl init` after suspend to reinit mic +{ + security.rtkit.enable = true; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + environment.systemPackages = with pkgs; [ + alsa-utils + pulseaudio + ponymix + ]; + + services.pipewire = { + enable = true; + systemWide = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + 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 ]" + } + ''; + }; +} diff --git a/nixos/modules/system/audio.nix b/nixos/modules/system/audio.nix index 181be32..72a68c4 100644 --- a/nixos/modules/system/audio.nix +++ b/nixos/modules/system/audio.nix @@ -87,21 +87,9 @@ in # because of systemWide ensure main user is in audio group system.custom.mainUser.extraGroups = [ "audio" "pipewire" ]; - #services.pipewire = { - # enable = true; - # systemWide = true; - # media-session.enable = true; - # pulse.enable = true; - # jack.enable = true; - # alsa.enable = true; - #}; - #hardware.pulseaudio.enable = false; - #security.rtkit.enable = true; - - # todo use pipewire for this hardware.pulseaudio = { - enable = true; + enable = false; package = pkgs.pulseaudioFull; # all in audio group can do audio systemWide = false;