(These 4 steps should explain the situation)
- Installing latest
nodejs
on command line? easynix-env -i nodejs
- Using latest
nodejs
inshell.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
nodejs
version on command line? easynix-env -i nodejs-14.5.0
- Using specific
nodejs
version 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.nix
and 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 versions
shell.nix derivations
shell.nix subversions
default.nix versions
default.nix derivations
default.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.