R
Railway12mo 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", "cdo@2.1.1"] 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
Percy12mo ago
Project ID: N/A
jeremy
jeremy12mo ago
N/A
Brody
Brody12mo ago
oh it's still Sunday, I'll tag jr in tomorrow
jeremy
jeremy12mo ago
yep, no worries, for now downgrading to nixpacksVersion = "1.15.0" fix the problem
Brody
Brody12mo ago
@jr - I swore there was a way to pin individual nix packages to a specific version
jr
jr12mo ago
Will come back to this thread in a few hours. Swamped atm
Brody
Brody12mo ago
no problem, thanks!
jeremy
jeremy12mo 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
Adam12mo ago
That’s best practice! I believe you can set package versions using a nixpacks.toml. @Brody am I correct with this?
Adam
Adam12mo 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
Brody12mo ago
I don't know the syntax either, jr definitely would, but if I had to guess it would be packageName@x.x.x
jeremy
jeremy12mo ago
So let’s say I want to fix node version. That would be nodejs_20@20.5.1 I can give it a try, see what it does during build phase
No description
Brody
Brody12mo ago
it's really just a wild guess
jeremy
jeremy12mo ago
it's a nope for @. I tried zlib@1.2.12
nixPkgs = ["...", "bzip2", "zlib@1.2.12", "hdf5", "netcdf", "eccodes", "cdo"]
nixPkgs = ["...", "bzip2", "zlib@1.2.12", "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 zlib@1.2.12
#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 zlib@1.2.12
Trying out with a dash now, but very little hope on this syntax
Want results from more Discord servers?
Add your server