My NixOS configuration (mirror)
1{
2 config,
3 lib,
4 ...
5}: {
6 options.modules.hardware.bluetooth.enable = lib.mkEnableOption "bluetooth support";
7
8 config = lib.mkIf config.modules.hardware.bluetooth.enable {
9 hardware.bluetooth = {
10 enable = true;
11 powerOnBoot = true;
12 settings.Policy.AutoEnable = true;
13 };
14 };
15}