nix Verified current stable Not installed? Build Tools

Nix / Build Package From Flake With Logs

Build Package From Flake With Logs

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

$
Terminal
nix build -L <.#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.
-L
L| print build logs
The value supplied for L| print build logs.
<.#pkg>
.#pkg
The value supplied for .#pkg.
-L
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative build tools tools for the same job.