Files
nix-config/modules/nixos/hardware/raspberry-pi/bluetooth.nix
mjallen18 5ee4da5b08 dtbs
2025-12-30 17:35:51 -06:00

30 lines
850 B
Nix

{ config, lib, pkgs, namespace, ... }:
let
cfg = config.${namespace}.hardware.raspberry-pi.disable-bluetooth;
variant = config.${namespace}.hardware.raspberry-pi.variant;
in
{
options.${namespace}.hardware.raspberry-pi.disable-bluetooth = {
enable = lib.mkEnableOption "enable disablewifi dt overlays";
};
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ] ++ (if (variant == "5") then
[
{
name = "disable-bt-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/disable-bt-pi5-overlay.dts";
}
]
else
[
{
name = "disable-bt-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/disable-bt-overlay.dts";
}
]);
};
};
}