nixos-config/nixos/modules/system/bluetooth.nix

35 lines
560 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;
2021-07-08 20:43:14 +02:00
settings.General.AutoConnect = true;
2019-10-24 02:20:38 +02:00
};
2020-04-13 21:10:54 +02:00
services.blueman.enable = true;
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
];
};
}