Modifying Nix Packages

João Vieira
There are a lot of already written Nix package definitions covering the most commonly used applications in Linux and macOS. However, for some reason or another, from time to time, you may wish to install a package with a slightly customized definition.

The example below will install yarn without explicitely depending on node, i.e., it will use whatever node version you have available on the environment.

To install simply run nix-env -f yarn.nix -i.

More generally, when extending a package.nix, you can follow the template below and run with nix-env -f your_file.nix -i