(These 4 steps should explain the situation)
- Installing latest
nodejson command line? easynix-env -i nodejs - Using latest
nodejsinshell.nix? easy
let
# (using niv for pinned versions)
sources = import ./nix/sources.nix;
normalPackages = import sources.nixpkgs {};
in
normalPackages.mkShell {
buildInputs = [
normalPackages.nodejs
];
}
- Installing specific
nodejsversion on command line? easynix-env -i nodejs-14.5.0 - Using specific
nodejsversion inshell.nix?
# ... no idea
How can the version be specified inside a shell.nix?
(version being one of the versions from nix-env -q --available nodejs)
What I have tried (over the course of ~1 week)
- typing variants of the first
shell.nixand hoping for the best - reading the manual on versions
- reading the manual on subversions
- reading the manual on derivations
- reading
niv-env --help - reading this long (great) post on medium about the Nix language
- reading this Fantastic post about nix project setup
- reading the FAQ on pinning nix packages
- searching this discourse for
shell.nix versionsshell.nix derivationsshell.nix subversionsdefault.nix versionsdefault.nix derivationsdefault.nix subversions
- reading these posts
- reading
- (and more)
I know nix is hard and all but dang; just learning how to specify a version in nix is taking about as long as learning all of Vue, React, and Ruby combined.