diff options
author | Yurii Matsiuk <24990891+ymatsiuk@users.noreply.github.com> | 2022-12-05 17:11:52 +0100 |
---|---|---|
committer | Yurii Matsiuk <24990891+ymatsiuk@users.noreply.github.com> | 2022-12-06 17:49:53 +0100 |
commit | 1d61d168a6fe30eb42c02fff8a097a5c224c7ec9 (patch) | |
tree | 766e116f75ab2999ccd8e8ca77ac4832b4978c3e | |
parent | 1a70303230ca1d7d96fcd0a7007327551465ae02 (diff) | |
download | nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.tar nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.tar.gz nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.tar.bz2 nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.tar.lz nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.tar.xz nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.tar.zst nixpkgs-1d61d168a6fe30eb42c02fff8a097a5c224c7ec9.zip |
nixos/bluetooth: add input and network service configs
-rw-r--r-- | nixos/modules/services/hardware/bluetooth.nix | 27 | ||||
-rw-r--r-- | pkgs/os-specific/linux/bluez/default.nix | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/services/hardware/bluetooth.nix b/nixos/modules/services/hardware/bluetooth.nix index 8b90c1913bc..c034d934f09 100644 --- a/nixos/modules/services/hardware/bluetooth.nix +++ b/nixos/modules/services/hardware/bluetooth.nix @@ -77,6 +77,29 @@ in }; description = lib.mdDoc "Set configuration for system-wide bluetooth (/etc/bluetooth/main.conf)."; }; + + input = mkOption { + type = cfgFmt.type; + default = { }; + example = { + General = { + IdleTimeout = 30; + ClassicBondedOnly = true; + }; + }; + description = lib.mdDoc "Set configuration for the input service (/etc/bluetooth/input.conf)."; + }; + + network = mkOption { + type = cfgFmt.type; + default = { }; + example = { + General = { + DisableSecurity = true; + }; + }; + description = lib.mdDoc "Set configuration for the network service (/etc/bluetooth/network.conf)."; + }; }; }; @@ -86,6 +109,10 @@ in environment.systemPackages = [ package ] ++ optional cfg.hsphfpd.enable pkgs.hsphfpd; + environment.etc."bluetooth/input.conf".source = + cfgFmt.generate "input.conf" cfg.input; + environment.etc."bluetooth/network.conf".source = + cfgFmt.generate "network.conf" cfg.network; environment.etc."bluetooth/main.conf".source = cfgFmt.generate "main.conf" (recursiveUpdate defaults cfg.settings); services.udev.packages = [ package ]; diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix index ff8fbb460b2..14372040d42 100644 --- a/pkgs/os-specific/linux/bluez/default.nix +++ b/pkgs/os-specific/linux/bluez/default.nix @@ -121,6 +121,10 @@ in stdenv.mkDerivation rec { mkdir $out/etc/bluetooth ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf + # https://github.com/NixOS/nixpkgs/issues/204418 + ln -s /etc/bluetooth/input.conf $out/etc/bluetooth/input.conf + ln -s /etc/bluetooth/network.conf $out/etc/bluetooth/network.conf + # Add missing tools, ref https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/bluez for files in `find tools/ -type f -perm -755`; do filename=$(basename $files) |