Merge pull request #204653 from ymatsiuk/ymatsiuk/bluetooth

nixos/bluetooth: add input and network service configs

authored by Francesco Gazzetta and committed by GitHub c956f85f 8389dff3

+31
+27
nixos/modules/services/hardware/bluetooth.nix
··· 71 71 }; 72 72 description = lib.mdDoc "Set configuration for system-wide bluetooth (/etc/bluetooth/main.conf)."; 73 73 }; 74 + 75 + input = mkOption { 76 + type = cfgFmt.type; 77 + default = { }; 78 + example = { 79 + General = { 80 + IdleTimeout = 30; 81 + ClassicBondedOnly = true; 82 + }; 83 + }; 84 + description = lib.mdDoc "Set configuration for the input service (/etc/bluetooth/input.conf)."; 85 + }; 86 + 87 + network = mkOption { 88 + type = cfgFmt.type; 89 + default = { }; 90 + example = { 91 + General = { 92 + DisableSecurity = true; 93 + }; 94 + }; 95 + description = lib.mdDoc "Set configuration for the network service (/etc/bluetooth/network.conf)."; 96 + }; 74 97 }; 75 98 }; 76 99 ··· 80 103 environment.systemPackages = [ package ] 81 104 ++ optional cfg.hsphfpd.enable pkgs.hsphfpd; 82 105 106 + environment.etc."bluetooth/input.conf".source = 107 + cfgFmt.generate "input.conf" cfg.input; 108 + environment.etc."bluetooth/network.conf".source = 109 + cfgFmt.generate "network.conf" cfg.network; 83 110 environment.etc."bluetooth/main.conf".source = 84 111 cfgFmt.generate "main.conf" (recursiveUpdate defaults cfg.settings); 85 112 services.udev.packages = [ package ];
+4
pkgs/os-specific/linux/bluez/default.nix
··· 130 130 mkdir $out/etc/bluetooth 131 131 ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf 132 132 133 + # https://github.com/NixOS/nixpkgs/issues/204418 134 + ln -s /etc/bluetooth/input.conf $out/etc/bluetooth/input.conf 135 + ln -s /etc/bluetooth/network.conf $out/etc/bluetooth/network.conf 136 + 133 137 # Add missing tools, ref https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/bluez 134 138 for files in `find tools/ -type f -perm -755`; do 135 139 filename=$(basename $files)