← Back to archive

Repo of the Day

cachix/nixcon-2024-workshop: NixCon 2024 devenv workshop

Published: Aug 30, 2026

Open repository ↗

NixCon 2024 devenv workshop. Contribute to cachix/nixcon-2024-workshop development by creating an account on GitHub.

Summary

cachix/nixcon-2024-workshop is a hands-on workshop from NixCon 2024 that teaches engineers how to use devenv to build reproducible, Nix-powered development environments. Rather than a finished product, it is a guided tutorial: it walks you, step by step, through turning a real Rust + Elm project (called Flakestry) into a one-command development setup. Each step shows a small, reviewable diff to a devenv.nix file, so you can see exactly how each feature is added.

What it is useful for

This repository is most useful for engineers who:

  • Already use or are considering Nix and want a friendlier front end than hand-rolled shell.nix files.
  • Need a reproducible, language-aware dev environment that includes backing services like PostgreSQL, OpenSearch, or Caddy.
  • Want a reference for combining multiple language toolchains in one environment — the example configures Rust (with a specific stable channel), JavaScript (with npm.install), TypeScript, and Elm together.
  • Need to encode process startup ordering: the workshop shows how to use process-compose.depends_on to make the backend wait until opensearch and postgres are healthy, which is a real-world pain point.
  • Want a worked example of dotenv loading, custom scripts, cargo-watch/elm-land processes, and git hooks (rustfmt, nixfmt, elm-format) in a single devenv.nix.

It is less useful if you are not working on a Nix-based machine, since devenv itself requires Nix.

How engineers can use it

The README documents a clear, end-to-end flow. First, install the prerequisites — git, nix, and devenv (plus optionally direnv) — following the platform instructions at https://devenv.sh/getting-started/. It also recommends adding a GitHub personal access token to ~/.config/nix/nix.conf to avoid rate limits:

access-tokens = github.com=<GITHUB_TOKEN>

Then clone the repo and step through the workshop:

git clone https://github.com/cachix/nixcon-2024-workshop && cd nixcon-2024-workshop
devenv init

From there, you progressively enable features — dotenv.enable, languages.rust, languages.javascript, languages.typescript, languages.elm, the caddy/opensearch/postgres services, custom scripts like run-migrations and flakestry-publish, and the backend/frontend processes. The final devenv.nix is included in full, so you can compare your edits to the reference.

To run the full Flakestry stack:

devenv up

Then open http://localhost:8888. The README notes one documented limitation: the backend may fail to initialize if OpenSearch is not yet ready, which the workshop resolves by adding process-compose.depends_on health conditions on opensearch and postgres. Bug reports go to https://github.com/cachix/devenv/issues, and discussion happens on the project Discord.

The repository is licensed under Apache-2.0, so the configuration patterns it demonstrates can be freely adapted to your own projects.