LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nix-eval

evaluates Nix expressions

TLDR

Evaluate expression
$ nix eval --expr "[1 + 1]"
copy
Evaluate from flake
$ nix eval [.#packages.x86_64-linux.default]
copy
Evaluate and apply function
$ nix eval --apply [builtins.attrNames] --expr "{a=1; b=2;}"
copy
Output as JSON
$ nix eval --json --expr "[{a = 1;}]"
copy
Evaluate file
$ nix eval -f [file.nix]
copy
Raw output
$ nix eval --raw --expr "\"hello\""
copy

SYNOPSIS

nix eval [options] [installable]

DESCRIPTION

nix eval evaluates Nix expressions. It outputs the evaluated value.The tool inspects Nix values. Useful for debugging and querying.

PARAMETERS

INSTALLABLE

Flake attribute to evaluate.
--expr EXPR
Nix expression.
--json
Output as JSON.
--raw
Raw string output.
--apply FUNC
Apply function to result.
--help
Display help information.

CAVEATS

Part of Nix CLI. Expression syntax. Flakes or expressions.

HISTORY

nix eval is part of the new Nix CLI providing expression evaluation functionality.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid