evix-0.1.0 is not a library.
evix
Experimental CLI utility using nix-bindings for the Nix C API, and a Rust replacement for nix-eval-jobs in Rust to leverage language features, and evaluate Nix expressions and stream derivation info as JSON lines in style.
Why evix?
- Faster evaluation by using threads
- Memory used for evaluation is reclaimed after nix-eval-jobs finish, so that the build can use it.
- Evaluation of jobs can fail individually
- It's really cool!
Usage
Exactly one input is required:
# Evaluate the hydraJobs attribute of the patchelf flake
}}
}}
}}
}}
}}
Options
| Flag | Description |
|---|---|
--flake REF |
Evaluate a flake output |
--expr EXPR |
Evaluate an inline Nix expression |
--file PATH |
Evaluate a Nix file |
--arg NAME EXPR |
Pass a Nix expression argument |
--argstr NAME VALUE |
Pass a string argument |
--workers N |
Worker processes (default: 1) |
--max-memory-size MB |
Memory limit per worker; restarts when exceeded (default: 4096) |
--force-recurse |
Recurse into all attrsets, ignoring recurseForDerivations |
--gc-roots-dir DIR |
Register GC root symlinks for evaluated derivations |
Output
Each line is a JSON object. Derivation attributes emit:
Non-derivation attrsets emit child attribute names for further recursion:
Errors are non-fatal unless "fatal": true:
Architecture
The binary operates in two modes based on the _NEJ_WORKER environment
variable:
- Master (default): Spawns worker subprocesses, manages a work queue of attr paths, distributes work via stdin/stdout, and collects results.
- Worker (
_NEJ_WORKER=1): Evaluates Nix expressions, processes individual attr paths, and signals when memory limits are reached.
Workers are restarted automatically when they exceed the memory limit.
Building
Requires Rust 1.90.0+. Supported on x86_64-linux and aarch64-linux.
License
EUPL-1.2