elodin-nix
Skill553 starsChanged 5 months agoApache-2.0View on GitHub
Work with the Nix development environment and NixOS configurations in Elodin. Use when troubleshooting nix develop, modifying flake.nix, adding Nix packages, setting up OrbStack VMs for Linux builds on macOS, or developing Aleph NixOS modules.
- Pipes a download into a shell
- Reads credentials
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bevySkill
- branch-regressionSkill
- elodin-alephSkill
- elodin-craneliftSkill
- elodin-dbSkill
- elodin-devSkill
- elodin-editor-devSkill
- elodin-headless-captureSkill
- elodin-monte-carloSkill
- elodin-simulationSkill
- elodin-tracySkill
- gltf-asset-optimizationSkill
- kdl-to-python-schematicSkill
- nox-py-devSkill
- qa-test-planSkill
- rustSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
No need to switch shells for different tasks — everything is in one environment.
- Distinctive: line 35
Use the Determinate Systems installer (recommended):
- Distinctive: line 43
Add your username to trusted users for binary cache access:
- Very specific: line 100
Create a NixOS VM named nixos
- Distinctive: line 158
Check binary cache connectivity
- Very specific: line 159
Ensure trusted-users is configured
- Very specific: line 166
Run nix flake update to refresh the lock file
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Elodin Nix Development
Elodin uses Nix flakes for reproducible builds, CI dependencies, Docker images, and the Aleph NixOS flight computer configuration.
Development Shell
The unified dev shell includes all tools for Rust, Python, C/C++, cloud operations, documentation, and git-lfs:
nix develop # Enter interactive shell (bash or zsh)
ELODIN_SHELL=zsh nix develop # Force zsh + p10k
ELODIN_SHELL=bash nix develop # Force bash
nix develop --command "cargo build" # One-off commandNo need to switch shells for different tasks — everything is in one environment.
Shell isolation
Each nix develop is self-contained so parallel worktrees and agent shells do not overwrite each other:
VIRTUAL_ENVis set to<worktree>/target/shells/$ELODIN_SHELL_ID/venvand prepended toPATHon entry. A bare venv is created on first entry if missing; do notsource .venv/bin/activate.just install pyinstalls into that venv.ELODIN_SHELL_IDcan be set to a path-safe persistent name before entering the shell. Otherwise it defaults to the terminal session id on Linux (ps -o sid= -p $$) and$$elsewhere. Reuse a named ID acrossnix developcalls when a workflow must preserve its venv and bin directory.ELODIN_SHELL_BINis<worktree>/target/shells/$ELODIN_SHELL_ID/bin. Automatically named numeric shells contain agarbage-collectablemarker and are pruned after their process dies. Explicitly named shells are retained.just installbuildselodin/elodin-dbinto$ELODIN_SHELL_BIN(this shell only).ELODIN_SHELLdefaults toauto, which walks parent processes forzshorbash(nix developoverwrites$SHELLwith bash). If none is found, bash is used.ELODIN_SHELL=zsh/ELODIN_SHELL=bashoverride. zsh setsSHELLto nix zsh and writes a wrapperZDOTDIR.zshrcthat sources~/.zshrcthen re-prepends the nix PATH; bash stays in the hook environment (no exec). Both definezar='gtar --zstd --sparse'.
Nix Installation
Use the Determinate Systems installer (recommended):
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installTrusted Users
Add your username to trusted users for binary cache access:
Determinate Nix — edit /etc/nix/nix.custom.conf:
trusted-users = root <your_username>Upstream Nix — edit /etc/nix/nix.conf:
experimental-features = nix-command flakes
trusted-users = root <your_username>Restart the daemon:
# macOS
sudo launchctl kickstart -k system/systems.determinate.nix-daemon
# Linux
sudo systemctl restart nix-daemon.serviceBinary Cache
Elodin maintains a binary cache to avoid rebuilding common dependencies:
elodin-nix-cache.s3.us-west-2.amazonaws.comThis is configured in flake.nix and used automatically by nix develop and nix build.
Flake Structure
Root flake.nix
Provides:
- Dev shell:
nix develop— unified development environment - Run shell:
nix develop .#run— packaged CLI/DB/Python plus GStreamer +elodinsink - Packages:
elodin-py,elodin-cli,elodin-db,elodinsink - Overlay:
elodinOverlaywith all Elodin packages - NixOS configs: NixOS 25.11 based
Key inputs: nixpkgs, rust-overlay (for toolchain from rust-toolchain.toml), crane (Rust builds).
aleph/flake.nix
NixOS configuration for the Aleph flight computer. Composes modules from aleph/modules/ into a complete system. See the elodin-aleph skill for details.
aleph/template/flake.nix
Template for users to create their own Aleph configurations. Imports Elodin's NixOS modules and configures services.
macOS Linux Builds (OrbStack VM)
Build Linux binaries on macOS using an OrbStack NixOS VM for remote builds:
- Install OrbStack
- Create a NixOS VM named
nixos - Configure SSH — add to
/var/root/.ssh/config:Host orb Hostname 127.0.0.1 Port 32222 - Register as build machine — add to
/etc/nix/machines:ssh://user@orb x86_64-linux,aarch64-linux /Users/user/.orbstack/ssh/id_ed25519 20 20 nixos-test,benchmark,big-parallel,kvm - - - Inside the VM, add to
/etc/nixos/configuration.nix:nix.settings.trusted-users = ["root" "@wheel"]; - Rebuild:
sudo nixos-rebuild switch - Test:
nix build --impure --expr '(with import <nixpkgs> { system = "x86_64-linux"; }; runCommand "foo" {} "uname > $out")'
OrbStack Disk Exhaustion
Qt builds can overflow /build tmpfs. Fix by using disk-backed build directory:
# In /etc/nixos/configuration.nix on the VM
nix.settings.build-dir = "/var/cache/nix-build";
systemd.tmpfiles.rules = [ "d /var/cache/nix-build 1777 root root -" ];Then:
sudo install -d -m 1777 /var/cache/nix-build
sudo nixos-rebuild switchAdding Packages to the Dev Shell
Edit the devShells section in the root flake.nix. The shell is built from a single unified definition that includes:
- Rust toolchain (from
rust-toolchain.toml) - Python 3.13 + uv + maturin
- C/C++ compilers and system libraries
- GStreamer (for video streaming)
- git-lfs
- Cloud operation tools
Nix Formatting
All .nix files are formatted with Alejandra (no configuration):
alejandraThis is enforced by CI.
Troubleshooting
nix develop hangs or is slow
- First run downloads and builds many dependencies — this is normal
- Check binary cache connectivity
- Ensure
trusted-usersis configured
Build failures referencing missing system libraries
- These are provided by the Nix shell; make sure you're inside
nix develop - For macOS-specific issues, check that Xcode Command Line Tools are installed
Hash mismatch errors
- Run
nix flake updateto refresh the lock file - Or pin specific inputs in
flake.lock
Key References
- Internal Nix docs: docs/internal/nix.md
- Root flake: flake.nix
- Aleph flake: aleph/flake.nix
- Nix overlay: defined in root
flake.nixaselodinOverlay
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

