by malmeloo · 8mo ago · 0 comments
The downside is that flake inputs refer to other flakes, not individual packages, so if you update the nixpkgs input it will upgrade all of your packages at once. For some packages such as Python, nixpkgs tracks multiple major versions so you can loosely pin to that version. You can also include nixpkgs as an input multiple times under different git tags/commits and only use that input for some of your packages to effectively pin them. You could keep using one nixpkgs but override the package's source to build it for a specific version/commit, but this setup could break in the future, because the derivation (and therefore build instructions) will keep evolving while your package's version will not. Or, if you really wanted to, you could straight up just copy the derivation from nixpkgs into your local repository and use that instead.
Nix is quite flexible so there's more options than just these, it just takes a little getting used to to find out what's possible. I don't use devenv myself, but some quick googling reveals it works just fine with flakes, so I would try that to see if it suits your needs.
> How do I set up my development environment using devenv.sh to pin nodejs to 24.14.0?
If I understand your response correctly, I can't do this in any very practical way.
languages.javascript.enable = true
languages.javascript.package = pkgs.nodejs_24In general though when working on a team, you dont really care about the _exact semver version_, you care about the major and handle version bumps by bumping the pin of nix packages.
~/repos/nixpkgs$ git log --grep='nodejs.* 24.14.0' -1 origin/master
commit 9c0e2056b3c16190aafe67e4d29e530fc1f8c7c7
Merge: d3a4e93b79c9 0873aea2d0da
Date: Tue Feb 24 16:53:40 2026 +0000
nodejs_24: 24.13.1 -> 24.14.0 (#493691)
~/repos/nixpkgs$ nix eval nixpkgs/9c0e2056b3c16190aafe67e4d29e530fc1f8c7c7#nodejs_24.version
"24.14.0"
~/repos/nixpkgs$