Skip to content

Add flake file#13

Open
viraptor wants to merge 1 commit into
Aeva:excelsiorfrom
viraptor:viraptor/flake
Open

Add flake file#13
viraptor wants to merge 1 commit into
Aeva:excelsiorfrom
viraptor:viraptor/flake

Conversation

@viraptor

@viraptor viraptor commented Apr 5, 2024

Copy link
Copy Markdown

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/
```
Comment thread flake.nix
name = "tangerine";
patches = [
(pkgs.fetchpatch {
url = "https://github.com/Aeva/tangerine/pull/12/commits/2d7d1ae1e21e8fe52df2c4a33e947b2ff6b07812.patch";

Copy link
Copy Markdown
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
Copy Markdown
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

Aeva commented Apr 27, 2024

Copy link
Copy Markdown
Owner

@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
Copy Markdown
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

Aeva commented May 6, 2024

Copy link
Copy Markdown
Owner

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

viraptor commented May 7, 2024

Copy link
Copy Markdown
Author

(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