-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feature request: nixGL integration #3968
Comments
I posted an implementation I've been using to wrap programs with nixGL, which i think could be general enough to be provided as a utility on |
a good first step would be to have nixGL in nixpkgs |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
hold on a moment stale-bot! |
I've accomplished the |
Can you create a PR @izelnakri ? |
Maybe something that would be good to have under the |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
This still needs solving. |
would love to see this implemented in home manager itself |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Still a valid issue |
For those following, I created a PR. You can test it by amending your { config, pkgs, ...}:
let
michaelCtsHm = builtins.fetchTarball "https://github.com/michaelCTS/home-manager/archive/refs/heads/feat/add-nixgl-workaround.zip";
nixGlModule = "${michaelCtsHm}/modules/misc/nixgl.nix";
in
{
imports = [ nixGlModule ];
workarounds.nixgl.packages = with pkgs; [
# A package of your choice here. alacritty is just an example
{ pkg = alacritty; }
];
} See the the nixgl module source (either in the nix store or the PR itself) for the objects to pass to With that, you should be able to open the package in your desktop environment. I tested it in openbox, but it should work with KDE, Gnome and others as well. |
@michaelCTS just tried this and ran into an issue. If I have |
@michaelCTS thank you for creating that PR! you've inspired me to finally put together my own utilizing the wrapper I posted near the top of this issue. I hope there are no hard feelings for waiting until you posted yours 😅 I am not immune to Cunningham's Law, but ultimately I hope the implementation that gets merged is the one that works best for everyone. @joefiorini if you want you can give #5355 a try. All you should need to do is set the |
@Smona I don't mind. It'll be up to the maintainers to decide which solution they prefer. It's just about time this issue is resolved. Whichever solution is chosen doesn't matter to me. It can always be iterated upon later and IMO there shouldn't be a focus on perfection, otherwise people will keep talking and never do anything. I modified my PR to make the wrapper available as well. We have different approaches of wrapping the package, so I think that will be the major difference. The one you use from stackoverflow does double the disk-space usage of the package IINM whereas what I used from the nixos wiki simply links to the existing package and writes one new bin. |
@michaelCTS (see edit below) I only have strong opinions about the API for HM users (which is harder to iterate on), not the specific wrapper used. I originally tried using Feel free to rip any other ideas from that PR, glad it could be of some help! In particular, I think these ideas are worth consideration:
Thanks again for pushing this forward! EDIT: I looked into it again and the wrapper in my PR does actually symlink the non-
So there is no disk usage downside to that wrapper. |
Your right @Smona! I didn't see the I'll close my PR in favor of yours. You'll probably be a more active maintainer. Hopefully it can be merged quickly. Cheers |
@michaelCTS I agree that In the interest of getting the initial implementation merged I might hold off on further refactoring on that branch if the current strategy looks good to maintainers, but changing the linking strategy is absolutely something we can iterate on in the future without breaking changes :) |
For anyone who wants to test #5355, I couldn't find an extensive way to do this, and I wanted to use Kitty, so this is what I did. I am using home-manager with flakes. I am new to all of this, so it might be obvious to many of the ones reading this, but it was not obvious to me. You can see the working sample at my dotfiles repo: I added NixGL to my input on nixGL = {
url = "github:nix-community/nixGL/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a";
inputs.nixpkgs.follows = "nixpkgs";
}; In I added @Smona's patch to my imports: imports = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/Smona/home-manager/nixgl-compat/modules/misc/nixgl.nix";
sha256 = "74f9fb98f22581eaca2e3c518a0a3d6198249fb1490ab4a08f33ec47827e85db";
})
]; I added an alias for nixGL, like so: let
nixGLIntel = inputs.nixGL.packages."${pkgs.system}".nixGLIntel;
#... I installed it by adding And I added the option: nixGL.prefix = "${nixGLIntel}/bin/nixGLIntel"; This changed my
I hope this helps someone. @Smona I hope your PR is merged soon so I can remove the customizations. Thanks for that! |
@giggio thank you so much for this little tutorial, everything works as expected! |
Somehow @giggio's approach gives me this error
any ideas? Edit: Alright fixed it by obtaining the new sha256 sum by doing (its Now I get :
Ok thats what I get for trying something different and trying Edit 2: Now I have the same problem @joefiorini mentioned with having colliding packages when Edit 3: |
Description
NixOS/nixpkgs#9415 which tracks the problem of libGL in nix on non NixOS systems has been open for about 8 years now. Luckily, nixGL exists which provides a wrapper around programs that require openGL (games, gpu accelerated terminals, browsers, etc.).
It would be great if there were an option to wrap all GUI applications or user-specified applications with
nixGL
. I'm assuming there's a generic way and bepoke method per application. Care should be taken for the desktop entries to call withnixGL
workarounds.opengl.packages
Is given a list of package names (or maybe packages themselves) that it has to wrap
lib.wrapWithLibGL
It could be a wrapper that takes a package and spits out another which is called by libGL.
The text was updated successfully, but these errors were encountered: