lol

nixos/bluetooth: add input and network service configs

+31
+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 + 81 + input = mkOption { 82 + type = cfgFmt.type; 83 + default = { }; 84 + example = { 85 + General = { 86 + IdleTimeout = 30; 87 + ClassicBondedOnly = true; 88 + }; 89 + }; 90 + description = lib.mdDoc "Set configuration for the input service (/etc/bluetooth/input.conf)."; 91 + }; 92 + 93 + network = mkOption { 94 + type = cfgFmt.type; 95 + default = { }; 96 + example = { 97 + General = { 98 + DisableSecurity = true; 99 + }; 100 + }; 101 + description = lib.mdDoc "Set configuration for the network service (/etc/bluetooth/network.conf)."; 102 + }; 80 103 }; 81 104 }; 82 105 ··· 86 109 environment.systemPackages = [ package ] 87 110 ++ optional cfg.hsphfpd.enable pkgs.hsphfpd; 88 111 112 + environment.etc."bluetooth/input.conf".source = 113 + cfgFmt.generate "input.conf" cfg.input; 114 + environment.etc."bluetooth/network.conf".source = 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 + # https://github.com/NixOS/nixpkgs/issues/204418 125 + ln -s /etc/bluetooth/input.conf $out/etc/bluetooth/input.conf 126 + ln -s /etc/bluetooth/network.conf $out/etc/bluetooth/network.conf 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)