mirror of
https://github.com/the-nix-way/dev-templates
synced 2025-07-24 16:19:46 +02:00
Dev environments for numerous languages based on Nix flakes
.github | ||
bun | ||
c-cpp | ||
clojure | ||
cue | ||
dhall | ||
elixir | ||
elm | ||
empty | ||
gleam | ||
go | ||
hashi | ||
haskell | ||
haxe | ||
java | ||
jupyter | ||
kotlin | ||
latex | ||
lean4 | ||
nickel | ||
nim | ||
nix | ||
node | ||
ocaml | ||
odin | ||
opa | ||
php | ||
platformio | ||
protobuf | ||
pulumi | ||
purescript | ||
python | ||
r | ||
ruby | ||
rust | ||
rust-toolchain | ||
scala | ||
shell | ||
swi-prolog | ||
swift | ||
vlang | ||
zig | ||
.editorconfig | ||
.envrc | ||
.gitignore | ||
flake.lock | ||
flake.nix | ||
README.md |
Nix flake templates for easy dev environments
To initialize (where ${ENV}
is listed in the table below):
nix flake init --template "https://flakehub.com/f/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"
# 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-direnv
installed, you can initialize the environment by runningdirenv allow
. - If you don't have
nix-direnv
installed, you can runnix develop
to open up the Nix-defined shell.
Available templates
Language/framework/tool | Template |
---|---|
Bun | bun |
C/C++ | c-cpp |
Clojure | clojure |
Cue | cue |
Dhall | dhall |
Elixir | elixir |
Elm | elm |
Empty (change at will) | empty |
Gleam | gleam |
Go | go |
Hashicorp tools | hashi |
Haskell | haskell |
Haxe | haxe |
Java | java |
Jupyter | jupyter |
Kotlin | kotlin |
LaTeX | latex |
Nickel | nickel |
Nim | nim |
Nix | nix |
Node.js | node |
OCaml | ocaml |
Odin | odin |
Open Policy Agent | opa |
PHP | php |
PlatformIO | platformio |
Protobuf | protobuf |
Pulumi | pulumi |
Purescript | purescript |
Python | python |
R | r |
Ruby | ruby |
Rust | rust |
Rust from toolchain file | rust-toolchain |
Scala | scala |
Shell | shell |
SWI-prolog | swi-prolog |
Swift | swift |
Vlang | vlang |
Zig | zig |
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
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
protobuf
pulumi
purescript
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.toml
file if present - From the
rust-toolchain
file if present - Version 1.78.0 if neither is present
- From the