nix-build
builds Nix expressions
TLDR
Build default.nix
$ nix-build
Build specific filecopy
$ nix-build [path/to/file.nix]
Build with attributecopy
$ nix-build -A [attribute]
Build from expressioncopy
$ nix-build -E "[with import <nixpkgs> {}; hello]"
Don't create result symlinkcopy
$ nix-build --no-out-link
Build and keep outputcopy
$ nix-build -o [result-link]
Show build logcopy
$ nix-build -v
copy
SYNOPSIS
nix-build [options] [path]
DESCRIPTION
nix-build builds Nix expressions. It creates derivations and builds them.The tool produces output in /nix/store. Creates result symlink by default.
PARAMETERS
PATH
Nix expression file.-A ATTR
Build specific attribute.-E EXPR
Build expression.--no-out-link
Don't create result link.-o LINK
Output symlink name.-v
Verbose mode.--help
Display help information.
CAVEATS
Legacy command. Consider nix build. Nix expressions required.
HISTORY
nix-build is part of Nix, providing the traditional build command interface.