Build a Nix expression (downloading from the cache when possible). See also:
nix-build
for information about traditional Nix builds from expressions,nix3 flake
for information about flakes. More information: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-build.html.
./result
:nix build nixpkgs#pkg
nix build -L .#pkg
nix build ./path/to/directory
result
symlink, instead printing the store path to the stdout
:nix build --no-link --print-out-paths