tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/bluetooth: add input and network service configs
Yurii Matsiuk
3 years ago
1d61d168
1a703032
+31
2 changed files
expand all
collapse all
unified
split
nixos
modules
services
hardware
bluetooth.nix
pkgs
os-specific
linux
bluez
default.nix
+27
nixos/modules/services/hardware/bluetooth.nix
···
77
77
};
78
78
description = lib.mdDoc "Set configuration for system-wide bluetooth (/etc/bluetooth/main.conf).";
79
79
};
80
80
+
81
81
+
input = mkOption {
82
82
+
type = cfgFmt.type;
83
83
+
default = { };
84
84
+
example = {
85
85
+
General = {
86
86
+
IdleTimeout = 30;
87
87
+
ClassicBondedOnly = true;
88
88
+
};
89
89
+
};
90
90
+
description = lib.mdDoc "Set configuration for the input service (/etc/bluetooth/input.conf).";
91
91
+
};
92
92
+
93
93
+
network = mkOption {
94
94
+
type = cfgFmt.type;
95
95
+
default = { };
96
96
+
example = {
97
97
+
General = {
98
98
+
DisableSecurity = true;
99
99
+
};
100
100
+
};
101
101
+
description = lib.mdDoc "Set configuration for the network service (/etc/bluetooth/network.conf).";
102
102
+
};
80
103
};
81
104
};
82
105
···
86
109
environment.systemPackages = [ package ]
87
110
++ optional cfg.hsphfpd.enable pkgs.hsphfpd;
88
111
112
112
+
environment.etc."bluetooth/input.conf".source =
113
113
+
cfgFmt.generate "input.conf" cfg.input;
114
114
+
environment.etc."bluetooth/network.conf".source =
115
115
+
cfgFmt.generate "network.conf" cfg.network;
89
116
environment.etc."bluetooth/main.conf".source =
90
117
cfgFmt.generate "main.conf" (recursiveUpdate defaults cfg.settings);
91
118
services.udev.packages = [ package ];
+4
pkgs/os-specific/linux/bluez/default.nix
···
121
121
mkdir $out/etc/bluetooth
122
122
ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf
123
123
124
124
+
# https://github.com/NixOS/nixpkgs/issues/204418
125
125
+
ln -s /etc/bluetooth/input.conf $out/etc/bluetooth/input.conf
126
126
+
ln -s /etc/bluetooth/network.conf $out/etc/bluetooth/network.conf
127
127
+
124
128
# Add missing tools, ref https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/bluez
125
129
for files in `find tools/ -type f -perm -755`; do
126
130
filename=$(basename $files)