libmemalloc 0.0.0-alpha
The Magic of Memory Transmutation
Loading...
Searching...
No Matches
nix

Nix development environments

The flake provides Linux x86_64 development shells. Tool selection lives in tools/nix/packages.toml; environment.nix composes those packages and reads the repository toolchain and Python manifests.

On this page


Enter an environment

Enable nix-command and flakes in your Nix installation, then run from the checkout:

nix develop ./tools/nix
nix develop ./tools/nix#build
nix develop ./tools/nix#docs

The default shell includes build, documentation, analysis, lint and release tools. The smaller shells select the corresponding catalog groups plus common host prerequisites. Lua includes luv. Native C/C++, Rust, Zig, C3 and WebAssembly tools are included; bare-metal compilation still requires an explicit target and toolchain configuration. External service credentials remain separate prerequisites.

Entering the shell does not install Python dependencies or change Git settings. Nix downloads and realizes its package closure through its normal store. Repository caches remain below .cache/.


Prepare Python and Ansible

When the workspace controller is already available, prepare the Nix environment through the playbook:

ansible-playbook playbook.yml -e lma_task=nix-setup

The task skips hosts without nix. On Nix hosts it realizes the default development shell, retains a profile at .cache/tools/nix/profile, and synchronizes the automation, quality and python-lint groups. It enables flakes for that invocation and refuses to update the committed flake lock. It does not edit user or system Nix configuration, and it does not change the parent terminal's environment.

For the first setup, before Ansible is available, invoke the same registered task with system Lua:

lua scripts/process/playbook.lua --direct nix-setup
nix develop ./tools/nix
lua scripts/workspace/bootstrap.lua

The Python installer uses the manifest and its lock, with an explicit project directory. It requires CPython 3.12, accepts binary wheels only for these groups, and refuses to rewrite an outdated lock. Bootstrap records the Lua and luv paths used by native Ansible. See workspace setup for controller paths.

The playbook activates Git defaults only in this repository. Repeated runs retain the existing include; --check leaves it untouched. The shell exposes the synchronized Python tools on PATH. Documentation's npm dependencies still use their own reviewed package lock and setup procedure.


Version boundaries

tools/nix/flake.lock fixes Nixpkgs and its content hash. The uv derivation reads its version and archive hash from the toolchain lock. Other Nix tools use the selected Nixpkgs host prerequisite versions. Lua and luv are built from the repository lock. Install the shared quality profile explicitly to use the same validator versions as CI; the shell puts its executable directory before host tools. Inspect the host catalog and qualification pins with:

nix build ./tools/nix#tool-versions
cat result

A shell provides development prerequisites; it does not establish that every qualification campaign uses its required compiler identity. Keep those campaign checks enabled. Edit tools.nixpkgs.revision in the central toolchain lock, run lua scripts/toolchain/sync.lua, then run nix flake lock ./tools/nix. Review the resulting input hash. See toolchain maintenance for the complete update flow. The Nix catalog is versioned by that single Nixpkgs revision; its package versions are not independently editable pins. Nix flakes in Git use tracked source files, so include newly added files in the change before evaluating the moved flake.

The design follows Nix flakes and uv locking and synchronization.