4 ms·
> Everything is pinned to exact source revisions. While you're here, how do you do this with nix-pkgs? I looked into using nixos for nodejs deployments recent
by s_kilk 7y ago
> Everything is pinned to exact source revisions.
While you're here, how do you do this with nix-pkgs?
I looked into using nixos for nodejs deployments recently, and was amazed to find that the versions of node in the nix-pkgs repo are just pinned to X.Y.0 releases, with no discernable way to update to a bugfix release after .0 , so... I don't see how this could possibly be used for production deployments?
https://nixos.org/nixos/packages.html?channel=nixpkgs-unstable&query=nodejs https://nixos.org/nixos/packages.html?channel=nixpkgs-unstab...
What I really want is to be able to tell nix to give me nodejs at version 10.16.3 and have it do the right thing every time.
I'm happy to be wrong on any of this.
- huevo5050 7y agoI think its a coincidence. Check nodejs commit history: https://github.com/NixOS/nixpkgs/commits/f3282c8d1e0ce6ba5d9f6aeddcfad51d879c7a4a/pkgs/development/web/nodejs https://github.com/NixOS/nixpkgs/commits/f3282c8d1e0ce6ba5d9... there are minor versions also
- s_kilk 7y agoRight, so if I'm understanding correctly, I'd need to pin the whole nix-pkgs system to the particular git revision which contains the version I need?
- huevo5050 7y agoThat's it, also you can cherry pick different software from different git revisions.
- silviogutierrez 7y agoDo you have any public examples of doing this? Or docs? Closest I found was to pin the nix-channel entirely, but not different components to different versions.
- soraminazuki 7y agoYou could do something like: let pinnedPkgs = import (builtins.fetchTarball {...}) {}; node = pinnedPkgs.nodejs-10_x; to refer to a specific version of node. https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs
- silviogutierrez 7y agoThanks that helps. I've mostly stuck to nix-shell -p foo bar baz to setup my environments. It's holding me back and I should pull the trigger on a shell.nix file, just gotta learn the language.
- soraminazuki 7y agoWhile the nix package manager supports the coexistence of multiple versions of a package, the nixpkgs package collection does not contain every single versions of every package. However, it does make it very easy to refer to past versions of a package by importing package specifications from an older version of nixpkgs. I think this is a reasonable choice, considering that the main purpose of nixpkgs is to provide packages for the NixOS distribution. It's impossible to actively maintain every single version of every package.