Skip to content

Make neovide GL implementation configurable #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
coderabbitai bot opened this issue Apr 9, 2025 · 0 comments
Open

Make neovide GL implementation configurable #1185

coderabbitai bot opened this issue Apr 9, 2025 · 0 comments
Assignees

Comments

@coderabbitai
Copy link

coderabbitai bot commented Apr 9, 2025

Background

Currently in PR #1184, the neovide wrapper for GL support is hardcoded to use nixGLIntel:

neovide =
  if cfg.needsGL
  then
    pkgs.writeShellScriptBin nvim.packages.x86_64-linux.neovide.meta.mainProgram ''
      ${lib.getExe nix-gl.packages.x86_64-linux.nixGLIntel} ${lib.getExe nvim.packages.x86_64-linux.neovide}
    ''
  else nvim.packages.x86_64-linux.neovide;

Issue

This implementation only works for Intel graphics cards and might cause issues on systems with NVIDIA or AMD graphics.

Suggested Solution

Make the GL implementation configurable, either by:

  1. Auto-detecting the GPU vendor using config.hardware attributes
  2. Adding a new option like profiles.base.glPackage to allow explicit configuration

Example implementation:

neovide =
  if cfg.needsGL
  then
    let
      glPackage = if config.hardware ? nvidia && config.hardware.nvidia.enable
                  then nix-gl.packages.x86_64-linux.nixGLNvidia
                  else nix-gl.packages.x86_64-linux.nixGLIntel;
    in
      pkgs.writeShellScriptBin nvim.packages.x86_64-linux.neovide.meta.mainProgram ''
        ${lib.getExe glPackage} ${lib.getExe nvim.packages.x86_64-linux.neovide}
      ''
  else nvim.packages.x86_64-linux.neovide;

This issue was requested by @NobbZ in PR #1184 comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant