Skip to content
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

Add flake file #13

Open
wants to merge 1 commit into
base: excelsior
Choose a base branch
from
Open

Add flake file #13

wants to merge 1 commit into from

Conversation

viraptor
Copy link

@viraptor viraptor commented Apr 5, 2024

Usage:

nix run  # run tangerine (default package)
nix develop  # enter development shell (cmake + dependencies available)
nix build  # get tangerine built and available in result/bin/

To enable flake commands in your environment, see https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS

Depending on your environment, you may want nixGLNvidia instead of nixGLIntel. I didn't go as far as parametrising / exposing that.

Usage:
```
nix run  # run tangerine (default package)
nix develop  # enter development shell (cmake + dependencies available)
nix build  # get tangerine built and available in result/bin/
```
name = "tangerine";
patches = [
(pkgs.fetchpatch {
url = "https://github.com/Aeva/tangerine/pull/12/commits/2d7d1ae1e21e8fe52df2c4a33e947b2ff6b07812.patch";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be your other pull request, correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct - once it's merged / updated, the list here can be updated.

@Aeva
Copy link
Owner

Aeva commented Apr 27, 2024

@viraptor nixGLIntel is fine for me, but I'm a little surprised that needs to be specified? I would have thought SDL2 would pull in an appropriate GL backend?

I'm a total noob to nix, so I think I need to spend some time learning what flakes is and how it works before I can give this a proper review. I think what I'm missing is a high level map of the many many ways one can install packages on nixos.

@viraptor
Copy link
Author

@Aeva So because of the idea of pure environment and no "system" dependencies this makes GL tricky. You could run in an impure environment and use system GL libraries through LD_LIBRARY_PATH (https://nixos.org/manual/nixpkgs/stable/#sec-opengl).

But if you want things to "just work" with consistent version between runs (proper nixpkgs way), then mesa becomes part of your environment and you have to explicitly pull it into the package environment.

@Aeva
Copy link
Owner

Aeva commented May 6, 2024

I'm confused. What's the normal way for OpenGL applications to be packaged, given that a user might need a completely different OpenGL subsystem depending on which vendor made their graphics card?

@viraptor
Copy link
Author

viraptor commented May 7, 2024

(chucks the app over the wall) "It's user's problem now."

Or more specifically, if you distribute it in nixpkgs, that side does not care about the opengl implementation at all. The user can run it through, for example:

nix run --impure github:nix-community/nixGL -- the_actual_app

which does some magic to select nvidia, or other driver.

For apps you normally use, you'd provide your own wrapper for them (like this PR does for the flake specifically), or use something like nix-community/home-manager#5355 with home-manager to do it semi-automatically. It's been a long-standing issue to implement it properly.

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

Successfully merging this pull request may close these issues.

2 participants