How to specify a fixed version for a nix package
Is there a way to specify a fixed version for
nixPkgs
? something like this:
nixPkgs = ["...", "zlib", "[email protected]"]
At the moment I downgraded nixpacks altogether with nixpacksVersion
but not idealSolution:Jump to solution
The only way to install specific versions of packages is to change the nix archive version to one where that package version is used. It is far from ideal and something we are working towards improving. This is just a limitation of how Nix works
20 Replies
Project ID:
N/A
N/A
oh it's still Sunday, I'll tag jr in tomorrow
yep, no worries, for now downgrading to
nixpacksVersion = "1.15.0"
fix the problem@jr - I swore there was a way to pin individual nix packages to a specific version
Will come back to this thread in a few hours. Swamped atm
no problem, thanks!
A small bump for this, still curious to know if that's possible.
Imo, new update of nixpacks had some braking consequences lately (1.16.0, 1.17.0). Not directly because of nixpacks, but because the bump for other packages that it includes.
I would rather want to fix all the packages I am using and manually updating them one by one when I want. Similar to a package.json where I define fixed versions for each packages so I don't get some random breaking changes when updating a patch version
^0.0.x
That’s best practice! I believe you can set package versions using a nixpacks.toml. @Brody am I correct with this?
Configuration File Reference | Nixpacks
App source + Nix packages + Docker = Image
doesn’t say anything in the docs, but I believe if you do “packageName-x.x.x” where x is the version number it will work
I don't know the syntax either, jr definitely would, but if I had to guess it would be
[email protected]
So let’s say I want to fix node version. That would be
[email protected]
I can give it a try, see what it does during build phaseit's really just a wild guess
it's a nope for
@
. I tried [email protected]
Trying out with a dash now, but very little hope on this syntaxmy 2 cents, nixpacks is great for a lot of things, but if you want total and complete control over every little thing during the build process, a dockerfile can't be beat
both apt and apk provide easy methods to specifying the package version to install
And dash doesn't work either.
Sure, that's a solution, I just hoped I didn't have to get to it. It's just convenient to have a one-liner in the railway.json file, rather than creating an additional Dockerfile to handle that
I getcha, and if it's not supported currently, it definitely should be
Solution
The only way to install specific versions of packages is to change the nix archive version to one where that package version is used. It is far from ideal and something we are working towards improving. This is just a limitation of how Nix works
thought so, thanks jr!