The source for the default Nix expressions used by nix-env:

It is loaded as follows:

Then, the resulting expression is interpreted like this:

For example, if the default expression contains two files, foo.nix and bar.nix, then the default Nix expression will be equivalent to

{
  foo = import ~/.nix-defexpr/foo.nix;
  bar = import ~/.nix-defexpr/bar.nix;
}

The file manifest.nix is always ignored.

The command nix-channel places a symlink to the user's current channels profile in this directory. This makes all subscribed channels available as attributes in the default expression.

A symlink that ensures that nix-env can find your channels:

This symlink points to:

In a multi-user installation, you may also have ~/.nix-defexpr/channels_root, which links to the channels of the root user.nix-env: ../nix-env.md