R
Railway15mo ago
jeremy

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 ideal
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
Jump to solution
20 Replies
Percy
Percy15mo ago
Project ID: N/A
jeremy
jeremyOP15mo ago
N/A
Brody
Brody15mo ago
oh it's still Sunday, I'll tag jr in tomorrow
jeremy
jeremyOP15mo ago
yep, no worries, for now downgrading to nixpacksVersion = "1.15.0" fix the problem
Brody
Brody15mo ago
@jr - I swore there was a way to pin individual nix packages to a specific version
jr
jr15mo ago
Will come back to this thread in a few hours. Swamped atm
Brody
Brody15mo ago
no problem, thanks!
jeremy
jeremyOP14mo ago
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
Adam
Adam14mo ago
That’s best practice! I believe you can set package versions using a nixpacks.toml. @Brody am I correct with this?
Adam
Adam14mo ago
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
Brody
Brody14mo ago
I don't know the syntax either, jr definitely would, but if I had to guess it would be [email protected]
jeremy
jeremyOP14mo ago
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 phase
No description
Brody
Brody14mo ago
it's really just a wild guess
jeremy
jeremyOP14mo ago
it's a nope for @. I tried [email protected]
nixPkgs = ["...", "bzip2", "[email protected]", "hdf5", "netcdf", "eccodes", "cdo"]
nixPkgs = ["...", "bzip2", "[email protected]", "hdf5", "netcdf", "eccodes", "cdo"]
#8 0.510 error: syntax error, unexpected '@'
#8 0.510
#8 0.510 at /app/.nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix:19:72:
#8 0.510
#8 0.510 18| '')
#8 0.510 19| bzip2 cdo eccodes hdf5 netcdf nodejs-18_x openssl yarn-1_x [email protected]
#8 0.510 error: syntax error, unexpected '@'
#8 0.510
#8 0.510 at /app/.nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix:19:72:
#8 0.510
#8 0.510 18| '')
#8 0.510 19| bzip2 cdo eccodes hdf5 netcdf nodejs-18_x openssl yarn-1_x [email protected]
Trying out with a dash now, but very little hope on this syntax
Brody
Brody14mo ago
my 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
jeremy
jeremyOP14mo ago
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
Brody
Brody14mo ago
I getcha, and if it's not supported currently, it definitely should be
Solution
jr
jr14mo ago
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
Brody
Brody14mo ago
thought so, thanks jr!
Want results from more Discord servers?
Add your server