Skip to content

Languages and frameworks

The standard build environment makes it easy to build typical Autotools-based packages with very little code. Any other kind of package can be accommodated by overriding the appropriate phases of stdenv. However, there are specialised functions in Nixpkgs to easily build packages for other programming languages, such as Perl or Haskell. These are described in this chapter.

Each supported language or software ecosystem has its own package set named <language or ecosystem>Packages, which can be explored in various ways:

For example, search for haskellPackages or rubyPackages.

  • Navigate attribute sets with nix repl.

This technique is generally useful to inspect Nix language data structures.

Example

# Navigate Java compiler variants in javaPackages with nix repl

$ nix repl '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable
nix-repl> javaPackages.<tab>
javaPackages.compiler               javaPackages.openjfx15              javaPackages.openjfx21              javaPackages.recurseForDerivations
javaPackages.jogl_2_4_0             javaPackages.openjfx17              javaPackages.openjfx22
javaPackages.mavenfod               javaPackages.openjfx19              javaPackages.override
javaPackages.openjfx11              javaPackages.openjfx20              javaPackages.overrideDerivation

nix-env is the only convenient way to do that, as it will skip attributes that fail assertions, such as when a package is marked as broken, rather than failing the entire evaluation.

Example

# List all Python packages in Nixpkgs

The following command lists all derivations names with their attribute path from the latest Nixpkgs rolling release (nixpkgs-unstable).

$ nix-env -qaP -f '<nixpkgs>' -A pythonPackages -I nixpkgs=channel:nixpkgs-unstable
pythonPackages.avahi                                                  avahi-0.8
pythonPackages.boost                                                  boost-1.81.0
pythonPackages.caffe                                                  caffe-1.0
pythonPackages.caffeWithCuda                                          caffe-1.0
pythonPackages.cbeams                                                 cbeams-1.0.3