Show HN: Nixhub.io – Find Specific Versions of Nix Packages
1–10 of 21 posts
Re: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#2Re: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#3I am currently using asdf, is there anything Nix does better than asdf?
1. It has a wider range of packages available vs asdf. Asdf can support runtimes that have an asdf plugin, whereas Nix has over 80,000 packages available in it's registry
2. Nix also handles the dependencies for the packages you want to install. If you runtime requires a compiler, specific libraries, etc, Nix will ensure those are installed.
Of course, Nix can be challenging to get started with. If you want to try Nix but find the language intimidating, you can try something like Devbox first.
Re: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#4Then what? How do I throw that in a configuration.nix or flake.nix file?
Re: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#5Ok, as a nix noob. I find a given package, say `nixpkgs/3276b62e6639096014652132f4824ac2b4f2a2c4#nodejs` Then what? How do I throw that in a configuration.nix or flake.nix file?
`nixpkgs-old.legacyPacakges.linux-x86_64.node`, or something like below
let pkgs = import nixpkgs-old {
system = "linux-x86_64";
} in pkgs.mkShell {
packages = [ pkgs.node ];
}Re: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#6Ok, as a nix noob. I find a given package, say `nixpkgs/3276b62e6639096014652132f4824ac2b4f2a2c4#nodejs` Then what? How do I throw that in a configuration.nix or flake.nix file?
1. Install in your global profile with the CLI:
nix profile install nixpkgs/3276b62e6639096014652132f4824ac2b4f2a2c4#nodejs
2. In a flake.nix, you can set an input with the nixpkgs commit hash, like: inputs = {
node-nixpkgs.url = "nixpkgs/3276b62e6639096014652132f4824ac2b4f2a2c4";
};
...and then use nodejs from that `node-nixpkgs` input to get the exact version you wantedRe: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#7Ok, as a nix noob. I find a given package, say `nixpkgs/3276b62e6639096014652132f4824ac2b4f2a2c4#nodejs` Then what? How do I throw that in a configuration.nix or flake.nix file?
For flake.nix, you add that to the inputs, for example, call it `nixpkgs-old`, and then reference the package of interest with: `nixpkgs-old.legacyPacakges.linux-x86_64.node`, or something like below let pkgs = import nixpkgs-old { system = "linux-x86_64"; } in pkgs.mkShell { packages = [ pkgs.node ]; }
let
pkgs = import nixpkgs-old { system = "linux-x86_64"; }
in
pkgs.mkShell { packages = [ pkgs.node ]; }
Combine this with the input statement in the comment below to get a decent flake. You can mix and match multiple inputs if you want to install different versions of packagesRe: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#8Ok, as a nix noob. I find a given package, say `nixpkgs/3276b62e6639096014652132f4824ac2b4f2a2c4#nodejs` Then what? How do I throw that in a configuration.nix or flake.nix file?
Re: Show HN: Nixhub.io – Find Specific Versions of Nix Packages
#9So if you want to view all the versions available for NodeJS, you can visit https://nixhub.io/packages/nodejs
You can even link to a specific version with an anchor link. For example, you can see NodeJS 19.8.0 at https://nixhub.io/packages/nodejs#19.8.0