Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nix packages and shells

The flake also exposes legacyPackages.<system>.cpuTarget, a function accepting an LLVM CPU name and returning a CPU-specific RustiQ package. See the Nix installation guide for commands and portability considerations. The default package remains portable.

The packages below are declared in flake.nix. All four shells share Rust build essentials. rust adds Rust development tools; mini-pyscf adds the Python reference-test environment to the minimal Rust shell; full combines both extensions. nix develop selects full by default.

Use nix develop .#<shell> to enter a named shell. The direnv setup can select the same names with RUSTIQ_DEV_SHELL; see Development environments.

Rust build essentials

PackagePurposeShells
Rust toolchain from rust-toolchain.tomlrustc, Cargo, Clippy, rustfmt, and Rust source components pinned to the project toolchainAll
cmakeBuilds native dependencies that use CMakeAll
pkg-configHelps native builds find installed librariesAll
libiconv (macOS only)Provides character conversion support needed by native builds on macOSAll on macOS

Rust development tools

The flake pins a NixOS 26.05 nixpkgs revision and uses its development tools directly, without local package overrides. Its cargo-dist package is version 0.31.0; before regenerating release workflows, install the version required by dist-workspace.toml as described in Releasing.

PackagePurposeShells
rust-analyzerRust language server for editor completion, diagnostics, and navigationrust, full
cargo-nextestRuns Rust tests with improved reporting and test isolationrust, full
cargo-denyChecks dependency licenses, advisories, sources, and duplicate cratesrust, full
cargo-aboutGenerates the third-party license notices used in distributionsrust, full
cargo-llvm-covMeasures Rust test code coverage using LLVM instrumentationrust, full
cargo-criterionRuns Criterion benchmarks through Cargorust, full
cargo-expandDisplays macro-expanded Rust coderust, full
cargo-editAdds, removes, and upgrades dependencies from the command linerust, full
cargo-dist (dist)Builds release archives, installers, and checksumsrust, full
cargo-info (cargo info)Displays crate metadata from registriesrust, full
baconWatches files and reruns selected Cargo checksrust, full
cargo-watchRuns Cargo commands when files changerust, full
gitSource control commandsrust, full
hyperfineRepeats and compares command-line benchmarksrust, full
jqReads and transforms JSON from the command linerust, full
mdbookBuilds and previews this manualrust, full
mdbook-mermaidPreprocesses Mermaid diagrams in the manualrust, full
nixdNix language server for editor supportrust, full
nixfmtFormats Nix expressionsrust, full
nickelParses and evaluates Nickel configuration filesrust, full
nlsNickel language server for editor diagnostics and completionrust, full
ripgrep (rg)Fast recursive text searchrust, full
timeReports elapsed time and resource usage for commandsrust, full
clang (Linux only)C/C++ compiler used by profiling and native development toolsrust, full on Linux
cargo-flamegraph (Linux only)Profiles Rust programs and creates flamegraphsrust, full on Linux
gdb (Linux only)Command-line debuggerrust, full on Linux
inferno (Linux only)Converts profiler output into flamegraphsrust, full on Linux
perf (Linux only)Linux performance-counter profilerrust, full on Linux
samply (macOS only)Sampling profiler for macOSrust, full on macOS

Python and scientific packages

Python dependencies are described by pyproject.toml and pinned in uv.lock. Nix builds the Python environments from those files. Python is 3.14 in this flake.

Package or groupPurposeShells
uvPython project and dependency manager for workflows outside the prebuilt shell environmentfull
pyscfIndependent quantum-chemistry implementation used for reference calculationsmini-pyscf, full
numpyArray and numerical operations used in tests and scientific Python toolsmini-pyscf, full
pytestRuns the PySCF reference test suitemini-pyscf, full
scipyScientific algorithms used by optional analysis and development toolsfull
matplotlibCreates plots for scientific analysisfull
ipykernelConnects Python environments to Jupyter kernelsfull
jupyterlabInteractive notebook environmentfull
ruffLints and formats Python codefull

mini-pyscf uses the Python test dependency group; full includes the default group, which combines dev, test, and linting. The helper nix run .#pyscf-check -- ... runs the reference tests against the packaged RustiQ binary. For example:

nix run .#pyscf-check -- -q

Other flake outputs

The flake also exposes nix build .#book to build this manual, nix build .#cargo-artifacts for cached Cargo dependency artifacts, and nix build .#pyscf-environment for the base PySCF environment. These are build outputs rather than development shells. The default package is the RustiQ CLI binary, available through nix build or explicitly through nix build .#default. Install a tagged version with nix profile install github:mveril/RustiQ/vVERSION, replacing vVERSION with a published tag. Both development and release revisions use this default package. Its online manual follows the Cargo version: a dev prerelease identifier selects development documentation; other versions select the matching versioned manual. No release flag is needed. See releasing.

Installed manual and completions

The default package includes manual pages for man rustiq and its subcommands, such as man rustiq-artifact-inspect. Every page links to the online book. The package also includes the complete offline HTML manual under share/doc/rustiq/manual/html, including local equation and diagram resources. From the repository root:

nix build
./result/bin/rustiq docs
./result/bin/rustiq docs --print-path

Use --web to open the online manual. Cargo-only installations use the online manual by default; see installation.

The package also installs Bash, Zsh, and Fish completions in the standard Nix locations. Shell discovery depends on your Nix profile and shell setup.

Nushell also loads the completion automatically at interactive startup when the profile exposes share/nushell/vendor/autoload through its data directories. On NixOS, enabling programs.nushell exposes share/nushell from the system profile. Other profiles may need their share directory in XDG_DATA_DIRS.

Nushell, PowerShell, and Elvish scripts are also provided under share/rustiq/completions/ for manual loading. From the repository root, build the package with nix build, then load the script in the matching shell:

use ./result/share/rustiq/completions/rustiq.nu *
. ./result/share/rustiq/completions/rustiq.ps1
source ./result/share/rustiq/completions/rustiq.elv

For persistent configuration, use the corresponding installed profile path instead of a checkout’s result link. PowerShell support registers native argument completion only.

Nix generates the files with a separate build tool and sets RUSTIQ_PACKAGING=true so both generators omit themselves from manuals and completions. The installed executable retains online but disables the Cargo features manpages and completions, so it does not offer generation commands or link their dependencies. Other packagers can set the same variable when generating assets for a binary built without those features. Nix checks build and test all features separately; package installation checks verify the installed assets and the absence of generator commands.

Useful references