I was wondering, why some packages appear in older versions than in the github repo when querying them via nix-env -qa .. . I learned that this is due to the fact that the master branch has not been merged to the unstable-channel.
How would I manually install a derivation from the master branch, in order to get the latest version?
Derivations are the building blocks of a Nix system, from a file system view point. The Nix language is used to describe such derivations.
The Nix Packages collection (Nixpkgs) is a set of thousands of packages for the Nix package manager, released under a permissive MIT/X11 license. Packages are available for several platforms, and can be used with the Nix package manager on most GNU/Linux distributions as well as NixOS.
What nix-darwin adds is configuration and service management using the same mechanism as NixOS and it's mostly intended for users that use or know NixOS and want to have some of the same features on a mac.
Going for the master branch can be a little risky as the binary substitutes might not be available and you can end building lot of packages.
That said, you can specify which nixpkgs
will be used by nix-env
with the -f
flag.
So let's say you want to build hello
from master, you can use the following:
$ nix-env -f https://github.com/NixOS/nixpkgs/archive/master.tar.gz -iA hello
It is also possible to try git branches packages in a nix shell by using -I nixpkgs=/path/to/nix/pkgs
:
$ nix-shell -p hello -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
The most flexible way is:
git clone https://github.com/nixos/nixpkgs
cd nixpkgs
nix-build -A hello
nix-env -i $(readlink result)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With