Nix flake templates for easy dev environments
June 7, 2026 ยท View on GitHub
To initialize (where ${ENV} is listed in the table below):
nix flake init --template "https://flakehub.com/f/the-nix-way/dev-templates/*#${ENV}"
You can also use the shorter GitHub form:
nix flake init -t github:the-nix-way/dev-templates#${ENV}
Here's an example (for the rust template):
# Initialize in the current project
nix flake init --template "https://flakehub.com/f/the-nix-way/dev-templates/*#rust"
# or with the short GitHub form
nix flake init -t github:the-nix-way/dev-templates#rust
# Create a new project
nix flake new --template "https://flakehub.com/f/the-nix-way/dev-templates/*#rust" ${NEW_PROJECT_DIRECTORY}
How to use the templates
Once your preferred template has been initialized, you can use the provided shell in two ways:
- If you have
nix-direnvinstalled, you can initialize the environment by runningdirenv allow. - If you don't have
nix-direnvinstalled, you can runnix developto open up the Nix-defined shell.
Available templates
Template contents
The sections below list what each template includes. In all cases, you're free to add and remove packages as you see fit; the templates are just boilerplate.
bun
c-cpp
clojure
csharp
- dotnet
- [omnisharp-roslyn]
- [Mono]
- [msbuild]
cue
dhall
- Dhall
- dhall-bash
- dhall-docs
- dhall-json
- dhall-lsp-server
- dhall-nix
- dhall-nixpkgs
- dhall-openapi
- dhall-toml
- dhall-yaml
elixir
elm
Empty
A dev template that's fully customizable.
gleam
go
- Go
- Standard Go tools (goimports, godoc, and others)
- golangci-lint
hashi
haskell
haxe
java
jupyter
kotlin
latex
lean4
nickel
nim
nix
node
ocaml
odin
opa
php
platformio
Presenterm
powershell
protobuf
pulumi
purescript
- Purescript (purs)
- Spago
python
r
ruby
- Ruby, plus the standard Ruby tools (
bundle,gem, etc.)
rust
- Rust, including cargo, Clippy, and the other standard tools. The Rust version is determined as follows, in order:
- From the
rust-toolchain.tomlfile if present - From the
rust-toolchainfile if present - Version 1.78.0 if neither is present
- From the
- rust-analyzer
- cargo-edit
- cargo-deny