nix Verified current stable Not installed? Build Tools

Nix / Build Package From Nixpkgs

Build Package From Nixpkgs

Nix command syntax to build package from nixpkgs. Copyable examples, output expectations, and common mistakes.

$
Terminal
nix build <nixpkgs#pkg>

Command Breakdown

What each part is doing

nix
Base Command
The executable that performs this operation. Here it runs Nix before the shell applies any redirect operators.
<nixpkgs#pkg>
nixpkgs#pkg
The value supplied for nixpkgs#pkg.

Alternative Approaches

Comparable commands in other tools

Alternative build tools tools for the same job.