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

feat: add nix flake.nix #7050

Closed
wants to merge 1 commit into from
Closed

Conversation

RobWalt
Copy link

@RobWalt RobWalt commented Feb 2, 2025

Connections

  • the existing shell.nix file

Description

There are currently two major ways of using nix: With and without flakes. Currently the repo only hosts a shell.nix file which supports the non-flake way of running nix stuff like development shells. This PR adds a flake.nix and a modularized directory nix where people can find the implementation of the flake-devshell.

  • Compared to the shell.nix file, this development shell only includes the necessary dependency to get the wgpu examples running. People are free to extend this minimal devshell and tailor it to their own needs.
  • The flake approach also supports locking dependencies which helps with the reproducibility of everything.

Testing

  • I entered the devShell on my machine and ran the hallmark example successfully. ✅

@RobWalt RobWalt requested a review from a team as a code owner February 2, 2025 14:41
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

I don't know how to review this in any seriousness, but idk it looks fine 😆

I am a bit worried about the growth of completely unrelated configurations to this repository - notably we do not have any ability to update them (none of us use nix) so they are probably going to atrophy without our knowledge and not be useful over the long term.

With the caviat that I do not completely understand the flow for nix-ians, but this feels like something that they would deal with on an individual level, or follow some template for rust graphics or something, as opposed to every repo having a flake.nix file for their own needs.

@teoxoy
Copy link
Member

teoxoy commented Feb 11, 2025

Tagging everyone that was involved in initial PR (#5519) for comments/review:

@MultisampledNight
@NyxAlexandra
@eddyb

@NyxAlexandra
Copy link

I think it would be nice to not duplicate dependency lists in shell.nix and nix/rust.nix. shell.nix seems to be a superset of nix/rust.nix, so it could be factored out with an import.

@teoxoy
Copy link
Member

teoxoy commented Feb 12, 2025

I am a bit worried about the growth of completely unrelated configurations to this repository - notably we do not have any ability to update them (none of us use nix) so they are probably going to atrophy without our knowledge and not be useful over the long term.

I agree with this as well. Since we can't guarantee that the config files will always be up to date, I don't see much benefit from them being hosted in the wgpu repo. Would it be possible to host the config files somewhere else (which wgpu could then link to)? Or is there another benefit to have them in repo?

@RobWalt
Copy link
Author

RobWalt commented Feb 12, 2025

Yeah that's probably also a valid option. I think we can close this here then, I'm fine with it. I'll create some templates and post them here once they're ready

@cwfitzgerald
Copy link
Member

We should probably pull the other nix thing from the repo then.

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.

4 participants