# Pi5 + DSI DRM KDL snippets (`desktop.niri.raspberryPi5DrmWorkaround`) — lives in `flake.lib`.
{ ... }:
let
  drmExtraConfig = ''
    debug {
      render-drm-device "/dev/dri/renderD128"
      ignore-drm-device "/dev/dri/card1"
      ignore-drm-device "/dev/dri/card2"
    }
  '';
in
{
  flake.lib.pi5NiriKdl = {
    inherit drmExtraConfig;

    # Keep in sync with DMS greeter niri template when upstream edits it.
    dankGreeterCompositorConfig = ''
      hotkey-overlay {
          skip-at-startup
      }

      environment {
          DMS_RUN_GREETER "1"
      }

      ${drmExtraConfig}

      gestures {
         hot-corners {
           off
         }
      }

      layout {
        background-color "#000000"
      }
    '';
  };
}
