1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# The D-Bus system bus policy for Floss, for this machine's users rather than
# ChromeOS's (chronos is the session there, cras the audio server).
#
# As ChromeOS's org.chromium.bluetooth.conf (etc/dbus-1/system.d in ../etc),
# with two differences:
# - the session user is whoever is in group `wheel`, and the audio server
# is in group `bluetooth-audio`; both may call the stack and the manager
# - btmanagerd starts btadapterd through systemd, not upstart, so the
# upstart allowances are gone (polkit decides, see module.nix)
{ pkgs, ... }:
pkgs.writeTextDir "share/dbus-1/system.d/org.chromium.bluetooth.conf" ''
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="bluetooth">
<allow own="org.chromium.bluetooth"/>
<allow own="org.chromium.bluetooth.Manager"/>
<allow send_destination="org.chromium.bluetooth"/>
<allow send_destination="org.chromium.bluetooth.Manager"/>
<!-- callbacks into clients: every *Callback interface -->
<allow send_type="method_call"/>
<!-- SystemdInvoker: systemctl restart/stop btadapterd@… -->
<allow send_destination="org.freedesktop.systemd1"/>
</policy>
<policy user="root">
<allow send_destination="org.chromium.bluetooth"/>
<allow send_destination="org.chromium.bluetooth.Manager"/>
</policy>
<policy group="wheel">
<allow send_destination="org.chromium.bluetooth"/>
<allow send_destination="org.chromium.bluetooth.Manager"/>
</policy>
<policy group="bluetooth-audio">
<allow send_destination="org.chromium.bluetooth"/>
<allow send_destination="org.chromium.bluetooth.Manager"/>
</policy>
</busconfig>
''
|