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

Nix flake #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

OliverEvans96
Copy link

Hello,

I've been working on building this example repo as a nix flake. Both nix build and nix develop seem to be working now.

The main outstanding issue is that the versions of wasm-bindgen in Cargo.lock and nixpkgs must match exactly, so I currently have the version from nixpkgs hard-coded into Cargo.toml.

If you have an idea for improving this issue, or have any other suggestions, I'm happy to make changes.

Cheers!
Oliver

@siku2
Copy link
Member

siku2 commented May 25, 2022

I'm glad you got this to work and I feel this deserves to be a template, I just don't think it should be part of this one. Nixpkgs is great, but so far it's not part of any workflow in Yew's documentation. Introducing it here might lead to a lot of confusion.

I think the best way forward is to turn this into a separate template and link to it in the documentation. What do you think?

@OliverEvans96
Copy link
Author

OliverEvans96 commented May 25, 2022

Hm, that's a good point. If this were just an example repo, I'd say it belongs here, but since this repo is explicitly intended for people to use to bootstrap their own projects, it does make sense to avoid adding any extra files. I would assume that most people using this repo don't use nix, and have probably never heard of it, so they probably don't want flake.nix in their own repo.

On the other hand, the reason I proposed it here is because as someone using NixOS and searching for an example flake, this seemed like the most likely place to find such an example.

It seems a bit strange to make it into a separate template, because it doesn't introduce any new functionality, and otherwise has the same directory structure, but I'm not opposed to the idea.

So yeah, those are just some thoughts. It should be somewhere obvious enough that people can find it, but not confuse people who don't need it.

I'm not sure what the best move is. I'm happy to move forward with your suggestion, or wait for others to weigh in.

@siku2
Copy link
Member

siku2 commented Jul 7, 2022

Seems like this has gone a bit stale. @yewstack/yew anyone have a strong opinion on this?

@WorldSEnder
Copy link
Member

I've heard good things about nix but I'm personally not comfortable enough to maintain it. The code looks straight forward, for the most part, but details such as

https://github.com/yewstack/yew-trunk-minimal-template/pull/5/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R15
and
https://github.com/yewstack/yew-trunk-minimal-template/pull/5/files#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0R14-R15

make me wonder: Is this cross-platform (i.e. x86-64 seems like it wouldn't work on ARM?), how much effort is it to maintain?

@futursolo
Copy link
Member

Having a nix-specific template to reside in a different repository should work equally well.
Especially when merging this means we have to include:

wasm-bindgen = "=0.2.79" # NOTE: This has to match the version in nixpkgs.

Personally, I think this would not be a way that everyone (most people?) would use to create a new project.
And we should not let a package manager to impose a limit on the template itself.

Plus, having to remove things when using a minimal template does not sound quite right.

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.

None yet

4 participants