diff --git a/configuration/desktop/audio.nix b/configuration/desktop/audio.nix index 19d70ac..f344089 100644 --- a/configuration/desktop/audio.nix +++ b/configuration/desktop/audio.nix @@ -14,6 +14,9 @@ pulse = { enable = true; }; + configPackages = [ + pkgs.pipewire-all-bluetooth + ]; }; environment.systemPackages = with pkgs; [ diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 9874d11..5bb0aca 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -23,6 +23,7 @@ final: prev: { nixfiles-generate-config = final.callPackage ./nixfiles/nixfiles-generate-config.nix {}; nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {}; nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {}; + pipewire-all-bluetooth = final.callPackage ./pipewire-all-bluetooth {}; print-afra = final.callPackage ./print-afra {}; run-with-docker-group = final.callPackage ./run-with-docker-group {}; ssh-gpg = final.callPackage ./ssh-gpg {}; diff --git a/pkgs/pipewire-all-bluetooth/all-bluetooth.conf b/pkgs/pipewire-all-bluetooth/all-bluetooth.conf new file mode 100644 index 0000000..4a4e38d --- /dev/null +++ b/pkgs/pipewire-all-bluetooth/all-bluetooth.conf @@ -0,0 +1,29 @@ +context.modules = [ +{ name = libpipewire-module-combine-stream + args = { + combine.mode = sink + node.name = "all-bluetooth" + node.description = "All Bluetooth devices" + combine.latency-compensate = false + combine.props = { + audio.position = [ FL FR ] + } + stream.props = { + } + stream.rules = [ + { + matches = [ + { + node.name = "~bluez_output.*" + media.class = "Audio/Sink" + } + ] + actions = { + create-stream = { + } + } + } + ] + } +} +] diff --git a/pkgs/pipewire-all-bluetooth/default.nix b/pkgs/pipewire-all-bluetooth/default.nix new file mode 100644 index 0000000..abd0d69 --- /dev/null +++ b/pkgs/pipewire-all-bluetooth/default.nix @@ -0,0 +1,9 @@ +{ +runCommand, +... }: + +runCommand "pipewire-all-bluetooth" {} '' + mkdir -p $out/share/pipewire/pipewire.conf.d + + cp ${./all-bluetooth.conf} $out/share/pipewire/pipewire.conf.d/all-bluetooth.conf +''