railwayapp / nixpacks

App source + Nix packages + Docker = Image
https://nixpacks.com
MIT License
2.55k stars 239 forks source link

Support specific node versions instead of just majors #1017

Open flybayer opened 10 months ago

flybayer commented 10 months ago

Feature request

This is a recurring frustration for our users, they expect to be able to set a specific node version instead of only a major.

Currently the only workaround I know of is to go spelunking in nixpks repo and find the commit for a certain version and then pin that version in nixpacks.toml. But this process is almost impossible to explain to users.

[phases.setup]
nixpkgsArchive = 'bf85265bb302cdfe137e06bb207cb63aaaa726e8'
github-actions[bot] commented 10 months ago

Hello, @flybayer! Thanks for your submission.

Our team will respond soon. If you need more immediate help, try our Forum or our Discord. Thanks!

coffee-cup commented 10 months ago

100%

This is an issue we see at Railway too. You can use https://lazamar.co.uk/nix-versions/ to find a specific version of a package, but it is not ideal. We've been trying a few things internally, but nothing prioritized at the moment. Very open to ideas or suggestions though.

flybayer commented 10 months ago

Could we stop using nix for nodejs and instead use something like fnm ?

coffee-cup commented 8 months ago

Could we stop using nix for nodejs and instead use something like fnm ?

Yes that is possible. Alternatively we could switch to something like asdf.

It would be a pretty fundamental change to Nixpacks though. Which I am not against, but would just need to weigh the options and decide of moving away from Nix for managing packages is the best option for managing packages.

supaspoida commented 8 months ago

In case it's helpful, I've been using rtx, now renamed to mise, a rust replacement for/wrapper around the asdf ecosystem on top of nixpacks to add additional tools not supported directly. It is available via nixpkgs so I just add it to the nixPkgs in my nixpacks.toml.

https://mise.jdx.dev/

I'd love to see it baked into nixpacks somehow though, maybe as an optional layer on top of the existing setup?