From 89d8acd8eb4251b0b5cc2d903d24277c45dd3eaf Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Thu, 1 Jun 2023 01:32:15 +0800 Subject: [PATCH] fix: audio support - enable pipewire only --- modules/nixos/core-desktop.nix | 37 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/modules/nixos/core-desktop.nix b/modules/nixos/core-desktop.nix index 4beb6456..2d2242f3 100644 --- a/modules/nixos/core-desktop.nix +++ b/modules/nixos/core-desktop.nix @@ -132,8 +132,28 @@ # replace default editor with neovim environment.variables.EDITOR = "nvim"; - # Enable sound with pipewire. - sound.enable = true; + # PipeWire is a new low-level multimedia framework. + # It aims to offer capture and playback for both audio and video with minimal latency. + # It support for PulseAudio-, JACK-, ALSA- and GStreamer-based applications. + # PipeWire has a great bluetooth support, it can be a good alternative to PulseAudio. + # https://nixos.wiki/wiki/PipeWire + 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; + }; + # rtkit is optional but recommended + security.rtkit.enable = true; + # Remove sound.enable or turn it off if you had it set previously, it seems to cause conflicts with pipewire + sound.enable = false; + # Disable pulseaudio, it conflicts with pipewire too. hardware.pulseaudio.enable = false; # https://flatpak.org/setup/NixOS @@ -153,19 +173,6 @@ geoclue2.enable = true; - 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; - }; - udev.packages = with pkgs; [ gnome.gnome-settings-daemon platformio # udev rules for platformio