nix build

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.

nix build {{nixpkgs#pkg}}

nix build -L {{.#pkg}}

nix build {{./path/to/directory}}

nix build --no-link --print-out-paths