dtsoverlays
This commit is contained in:
34
modules/nixos/hardware/raspberry-pi/wifi.nix
Normal file
34
modules/nixos/hardware/raspberry-pi/wifi.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ config, lib, pkgs, namespace, ... }:
|
||||
let
|
||||
cfg = config.${namespace}.hardware.raspberry-pi.disable-wifi;
|
||||
variant = config.${namespace}.hardware.raspberry-pi.variant;
|
||||
in
|
||||
{
|
||||
options.${namespace}.hardware.raspberry-pi.disable-wifi = {
|
||||
enable = lib.mkEnableOption "enable disablewifi dt overlays";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.deviceTree = {
|
||||
overlays =
|
||||
[ ] ++ (if (variant == "5") then
|
||||
[
|
||||
{
|
||||
name = "disable-wifi-pi5-overlay";
|
||||
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/share/raspberrypi-overlays/disable-wifi-pi5-overlay.dts";
|
||||
}
|
||||
]
|
||||
else
|
||||
[
|
||||
{
|
||||
name = "disable-wifi-overlay";
|
||||
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/share/raspberrypi-overlays/disable-wifi-overlay.dts";
|
||||
}
|
||||
{
|
||||
name = "wifimac-overlay";
|
||||
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/share/raspberrypi-overlays/wifimac-overlay.dts";
|
||||
}
|
||||
]);
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user