git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/pipewire: add bluez hardware database
commitef532a04436001249a7c24e13c628e970791dc7f authorarcnmx <arcnmx@users.noreply.github.com> dateMon 28 Jun 2021, 11:07 (5 years ago) parenteb7e40f
3 files changed+204
nixos/modules/services/desktops/pipewire/bluez-hardware.conf.json+197 nixos/modules/services/desktops/pipewire/pipewire-media-session.nix+6 pkgs/development/libraries/pipewire/default.nix+1
nixos/modules/services/desktops/pipewire/bluez-hardware.conf.jsonnew file+197
@@ -0,0 +1,197 @@
1+{
2+ "bluez5.features.device": [
3+ {
4+ "name": "Air 1 Plus",
5+ "no-features": [
6+ "hw-volume-mic"
7+ ]
8+ },
9+ {
10+ "name": "AirPods",
11+ "no-features": [
12+ "msbc-alt1",
13+ "msbc-alt1-rtl"
14+ ]
15+ },
16+ {
17+ "name": "AirPods Pro",
18+ "no-features": [
19+ "msbc-alt1",
20+ "msbc-alt1-rtl"
21+ ]
22+ },
23+ {
24+ "name": "AXLOIE Goin",
25+ "no-features": [
26+ "msbc-alt1",
27+ "msbc-alt1-rtl"
28+ ]
29+ },
30+ {
31+ "name": "JBL Endurance RUN BT",
32+ "no-features": [
33+ "msbc-alt1",
34+ "msbc-alt1-rtl",
35+ "sbc-xq"
36+ ]
37+ },
38+ {
39+ "name": "JBL LIVE650BTNC"
40+ },
41+ {
42+ "name": "Soundcore Life P2-L",
43+ "no-features": [
44+ "msbc-alt1",
45+ "msbc-alt1-rtl"
46+ ]
47+ },
48+ {
49+ "name": "Urbanista Stockholm Plus",
50+ "no-features": [
51+ "msbc-alt1",
52+ "msbc-alt1-rtl"
53+ ]
54+ },
55+ {
56+ "address": "~^94:16:25:",
57+ "no-features": [
58+ "hw-volume"
59+ ]
60+ },
61+ {
62+ "address": "~^9c:64:8b:",
63+ "no-features": [
64+ "hw-volume"
65+ ]
66+ },
67+ {
68+ "address": "~^a0:e9:db:",
69+ "no-features": [
70+ "hw-volume"
71+ ]
72+ },
73+ {
74+ "address": "~^0c:a6:94:",
75+ "no-features": [
76+ "hw-volume"
77+ ]
78+ },
79+ {
80+ "address": "~^00:14:02:",
81+ "no-features": [
82+ "hw-volume"
83+ ]
84+ },
85+ {
86+ "address": "~^44:5e:f3:",
87+ "no-features": [
88+ "hw-volume"
89+ ]
90+ },
91+ {
92+ "address": "~^d4:9c:28:",
93+ "no-features": [
94+ "hw-volume"
95+ ]
96+ },
97+ {
98+ "address": "~^00:18:6b:",
99+ "no-features": [
100+ "hw-volume"
101+ ]
102+ },
103+ {
104+ "address": "~^b8:ad:3e:",
105+ "no-features": [
106+ "hw-volume"
107+ ]
108+ },
109+ {
110+ "address": "~^a0:e9:db:",
111+ "no-features": [
112+ "hw-volume"
113+ ]
114+ },
115+ {
116+ "address": "~^00:24:1c:",
117+ "no-features": [
118+ "hw-volume"
119+ ]
120+ },
121+ {
122+ "address": "~^00:11:b1:",
123+ "no-features": [
124+ "hw-volume"
125+ ]
126+ },
127+ {
128+ "address": "~^a4:15:66:",
129+ "no-features": [
130+ "hw-volume"
131+ ]
132+ },
133+ {
134+ "address": "~^00:14:f1:",
135+ "no-features": [
136+ "hw-volume"
137+ ]
138+ },
139+ {
140+ "address": "~^00:26:7e:",
141+ "no-features": [
142+ "hw-volume"
143+ ]
144+ },
145+ {
146+ "address": "~^90:03:b7:",
147+ "no-features": [
148+ "hw-volume"
149+ ]
150+ }
151+ ],
152+ "bluez5.features.adapter": [
153+ {
154+ "bus-type": "usb",
155+ "vendor-id": "usb:0bda"
156+ },
157+ {
158+ "bus-type": "usb",
159+ "no-features": [
160+ "msbc-alt1-rtl"
161+ ]
162+ },
163+ {
164+ "no-features": [
165+ "msbc-alt1-rtl"
166+ ]
167+ }
168+ ],
169+ "bluez5.features.kernel": [
170+ {
171+ "sysname": "Linux",
172+ "release": "~^[0-4]\\.",
173+ "no-features": [
174+ "msbc-alt1",
175+ "msbc-alt1-rtl"
176+ ]
177+ },
178+ {
179+ "sysname": "Linux",
180+ "release": "~^5\\.[1-7]\\.",
181+ "no-features": [
182+ "msbc-alt1",
183+ "msbc-alt1-rtl"
184+ ]
185+ },
186+ {
187+ "sysname": "Linux",
188+ "release": "~^5\\.(8|9|10)\\.",
189+ "no-features": [
190+ "msbc-alt1"
191+ ]
192+ },
193+ {
194+ "no-features": []
195+ }
196+ ]
197+}
nixos/modules/services/desktops/pipewire/pipewire-media-session.nix+6
@@ -15,6 +15,7 @@ let
1515 defaults = {
1616 alsa-monitor = (builtins.fromJSON (builtins.readFile ./alsa-monitor.conf.json));
1717 bluez-monitor = (builtins.fromJSON (builtins.readFile ./bluez-monitor.conf.json));
18+ bluez-hardware = (builtins.fromJSON (builtins.readFile ./bluez-hardware.conf.json));
1819 media-session = (builtins.fromJSON (builtins.readFile ./media-session.conf.json));
1920 v4l2-monitor = (builtins.fromJSON (builtins.readFile ./v4l2-monitor.conf.json));
2021 };
@@ -22,6 +23,7 @@ let
2223 configs = {
2324 alsa-monitor = recursiveUpdate defaults.alsa-monitor cfg.config.alsa-monitor;
2425 bluez-monitor = recursiveUpdate defaults.bluez-monitor cfg.config.bluez-monitor;
26+ bluez-hardware = defaults.bluez-hardware;
2527 media-session = recursiveUpdate defaults.media-session cfg.config.media-session;
2628 v4l2-monitor = recursiveUpdate defaults.v4l2-monitor cfg.config.v4l2-monitor;
2729 };
@@ -120,6 +122,10 @@ in {
120122 mkIf config.services.pipewire.pulse.enable {
121123 source = json.generate "bluez-monitor.conf" configs.bluez-monitor;
122124 };
125+ environment.etc."pipewire/media-session.d/bluez-hardware.conf" =
126+ mkIf config.services.pipewire.pulse.enable {
127+ source = json.generate "bluez-hardware.conf" configs.bluez-hardware;
128+ };
123129
124130 environment.etc."pipewire/media-session.d/with-jack" =
125131 mkIf config.services.pipewire.jack.enable {
pkgs/development/libraries/pipewire/default.nix+1
@@ -192,6 +192,7 @@ let
192192 paths-out-media-session = [
193193 "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
194194 "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
195+ "nix-support/etc/pipewire/media-session.d/bluez-hardware.conf.json"
195196 "nix-support/etc/pipewire/media-session.d/media-session.conf.json"
196197 "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
197198 ];