modules: add bluetooth
This commit is contained in:
parent
4319105aa5
commit
35b8de02c2
38
modules/bluetooth.nix
Normal file
38
modules/bluetooth.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.modules.bluetooth;
|
||||
in
|
||||
{
|
||||
options.my.modules.bluetooth = with lib; {
|
||||
enable = mkEnableOption "wireless configuration";
|
||||
|
||||
enableHeadsetIntegration = my.mkDisableOption "A2DP sink configuration";
|
||||
|
||||
loadExtraCodecs = my.mkDisableOption "extra audio codecs";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
# Enable bluetooth devices and GUI to connect to them
|
||||
{
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
}
|
||||
|
||||
# Support for additional bluetooth codecs
|
||||
(lib.mkIf cfg.loadExtraCodecs {
|
||||
hardware.pulseaudio = {
|
||||
extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||||
package = pkgs.pulseaudioFull;
|
||||
};
|
||||
})
|
||||
|
||||
# Support for A2DP audio profile
|
||||
(lib.mkIf cfg.enableHeadsetIntegration {
|
||||
hardware.bluetooth.settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./bluetooth.nix
|
||||
./documentation.nix
|
||||
./ergodox.nix
|
||||
./home.nix
|
||||
|
|
Loading…
Reference in a new issue