To search packages in the haskellPackages namespace:

$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages

To install packages, which live in the haskellPackages namespace, use -A:

$ nix-env -f "<nixpkgs>" -i -A haskellPackages.ghc

See User's Guide to the Haskell Infrastructure for more information.

To fix various problems, use nix-shell:

$ nix-shell -p zlib zlibStatic

To use the latest Agda, pull the latest nixpkgs and install directly:

$ nix-env -f /path/to/nixpkgs -i -A haskellPackages.Agda

To list all known Haskell compilers in Nix:

$ nix-instantiate --eval -E "with import <nixpkgs> {}; lib.attrNames haskell.compiler"

nix-repl can also be used to do this:

$ nix-env -i nix-repl
$ nix-repl
nix-repl> :l <nixpkgs>
nix-repl> haskell.compiler.ghc<Tab>