home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit 5fbd29322070d55b8e6c72762fa0a73b7c2ca2f0
parent 4216d243eaa6b1788f51b5579385b332c7f8d265
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Fri,  5 Jan 2024 12:02:27 +0100

hardware/audio: try to use some user configuration…

… to make it use a session ?

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Msystems/modules/hardware/audio.nix | 61++++++++++++++++++++++++++++++-------------------------------
Ausers/vincent/desktop/audio.nix | 24++++++++++++++++++++++++
Musers/vincent/desktop/default.nix | 1+
3 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/systems/modules/hardware/audio.nix b/systems/modules/hardware/audio.nix @@ -38,40 +38,39 @@ in pulse.enable = true; wireplumber.enable = true; }; - environment.etc."pipewire/pipewire.conf.d/session-manager.conf".text = '' - context.modules = [ - { - name = libpipewire-module-session-manager - args = { } - } - ] - ''; - environment.etc."pipewire/pipewire.conf.d/zeroconf-discover.conf".text = '' - context.modules = [ - { - name = libpipewire-module-zeroconf-discover - args = { } - } - ] - ''; - environment.etc."pipewire/pipewire.conf.d/raop-discover.conf".text = '' - context.modules = [ - { - name = libpipewire-module-raop-discover - args = { } - } - ] - ''; + environment.etc = { + # "pipewire/pipewire.conf.d/session-manager.conf".text = '' + # context.modules = [ + # { name = libpipewire-module-session-manager } + # { name = libpipewire-module-client-device } + # ] + # ''; + "pipewire/pipewire-pulse.conf.d/50-network-party.conf".text = '' + context.exec = [ + { path = "pactl" args = "load-module module-native-protocol-tcp" } + { path = "pactl" args = "load-module module-zeroconf-discover" } + { path = "pactl" args = "load-module module-zeroconf-publish" } + ] + ''; + "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 ]" + } + ''; + }; + /* + wireplumber.profiles = { + main = { + monitor.alsa = required + } + } + */ networking.firewall = { allowedTCPPorts = [ 6001 6002 ]; }; - environment.etc."pipewire/pipewire-pulse.conf.d/50-network-party.conf".text = '' - context.exec = [ - { path = "pactl" args = "load-module module-native-protocol-tcp" } - { path = "pactl" args = "load-module module-zeroconf-discover" } - { path = "pactl" args = "load-module module-zeroconf-publish" } - ] - ''; }) (mkIf cfg.pulseaudio.enable { # Enable and configure pulseaudio diff --git a/users/vincent/desktop/audio.nix b/users/vincent/desktop/audio.nix @@ -0,0 +1,24 @@ +{ config, nixosConfig, lib, pkgs, ... }: + +{ + xdg.configFile = lib.mkIf nixosConfig.services.pipewire.wireplumber.enable { + "pipewire/pipewire.conf.d/raop-discover.conf" = { + text = '' + context.modules = [ + { + name = libpipewire-module-raop-discover + args = { } + } + ] + ''; + }; + "pipewire/pipewire.conf.d/zeroconf-discover.conf".text = '' + context.modules = [ + { + name = libpipewire-module-zeroconf-discover + args = { } + } + ] + ''; + }; +} diff --git a/users/vincent/desktop/default.nix b/users/vincent/desktop/default.nix @@ -13,6 +13,7 @@ in ./mpv.nix ./spotify.nix ./passwordstore.nix + ./audio.nix ] ++ optionals nixosConfig.modules.desktop.xorg.enable [ ./xorg.nix ] ++ optionals nixosConfig.profiles.desktop.i3.enable [ ./i3.nix ./xorg.nix ]