Files
nix-config/modules/nixos/hardware/raspberry-pi/modesetting.nix
mjallen18 70002a19e2 hmm
2026-04-07 18:39:42 -05:00

41 lines
968 B
Nix
Executable File

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