nixos-config/nixos/modules/system/bluetooth.nix
2021-11-01 09:20:42 +01:00

35 lines
560 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.system.custom.bluetooth;
in
{
options.system.custom.bluetooth.enable =
lib.mkEnableOption "enable bluetooth support";
config = lib.mkIf cfg.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings.General.AutoConnect = true;
};
services.blueman.enable = true;
environment.systemPackages = with pkgs; [
# bluetooth audio
# ---------------
# todo : check if pulseaudio is enabled
bluez
bluez-tools
];
};
}