nixos-config/modules/system/bluetooth.nix

36 lines
556 B
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.system.custom.bluetooth;
in {
2019-12-20 05:54:26 +01:00
options.system.custom.bluetooth.enable =
lib.mkEnableOption "enable bluetooth support";
2019-10-24 02:20:38 +02:00
config = lib.mkIf cfg.enable {
hardware.bluetooth = {
2019-12-20 05:54:26 +01:00
enable = true;
2019-10-24 02:20:38 +02:00
powerOnBoot = true;
extraConfig = ''
2019-12-20 05:54:26 +01:00
[General]
AutoConnect=true
2019-10-24 02:20:38 +02:00
'';
};
2019-12-20 05:54:26 +01:00
environment.systemPackages = with pkgs; [
2019-10-24 02:20:38 +02:00
# bluetooth audio
# ---------------
# todo : check if pulseaudio is enabled
bluez
bluez-tools
];
};
}