LinuxCommandLibrary

nix-build

builds Nix expressions

TLDR

Build default.nix

$ nix-build
copy
Build specific file
$ nix-build [path/to/file.nix]
copy
Build with attribute
$ nix-build -A [attribute]
copy
Build from expression
$ nix-build -E "[with import <nixpkgs> {}; hello]"
copy
Don't create result symlink
$ nix-build --no-out-link
copy
Build and keep output
$ nix-build -o [result-link]
copy
Show build log
$ 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.

SEE ALSO

nix(1), nix-shell(1), nix-env(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community