1
1
mirror of https://github.com/the-nix-way/dev-templates synced 2024-12-21 02:54:12 +01:00
Dev environments for numerous languages based on Nix flakes
Go to file
2024-10-12 00:19:54 +03:00
.github Include output paths in published flake 2024-07-20 12:43:38 -07:00
bun Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
c-cpp Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
clojure Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
csharp Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
cue Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
dhall Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
elixir Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
elm Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
empty Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
gleam Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
go Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
hashi Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
haskell Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
haxe Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
java Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
jupyter Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
kotlin Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
latex Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
lean4 Add support for Lean 4 2024-10-12 00:19:54 +03:00
nickel Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
nim Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
nix Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
node Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
ocaml Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
opa Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
php Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
platformio Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
protobuf Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
pulumi Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
purescript Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
python Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
r Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
ruby Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
rust Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
rust-toolchain Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
scala Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
shell Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
swift Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
vlang Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
zig Upgrade all flake.lock files 2024-09-13 00:20:29 +02:00
.editorconfig Add editorconfig file 2022-07-12 02:01:42 +02:00
.envrc Update clojure and csharp 2023-07-13 15:15:22 -07:00
.gitignore Add dvt script to flake outputs 2022-10-21 11:12:21 +02:00
flake.lock Update flake 2024-09-12 23:07:12 +02:00
flake.nix Add support for Lean 4 2024-10-12 00:19:54 +03:00
README.md Add support for Lean 4 2024-10-12 00:19:54 +03:00

Nix flake templates for easy dev environments

built with nix

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:

  1. If you have nix-direnv installed, you can initialize the environment by running direnv allow.
  2. If you don't have nix-direnv installed, you can run nix develop to open up the Nix-defined shell.

Available templates

Language/framework/tool Template
Bun bun
C/C++ c-cpp
Clojure clojure
C# csharp
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
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
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

csharp

cue

dhall

elixir

elm

Empty

A dev template that's fully customizable.

gleam

go

hashi

haskell

haxe

java

jupyter

kotlin

latex

lean4

nickel

nim

nix

node

ocaml

opa

php

platformio

protobuf

pulumi

purescript

python

r

ruby

  • Ruby 3.2.2, 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
  • rust-analyzer 2024-04-29

  • [cargo-edit] 0.12.2

  • cargo-deny 0.14.23

scala

shell

swift

vlang

zig

Code organization

All of the templates have only the root flake as a flake input. That root flake provides a common revision of Nixpkgs and flake-utils to all the templates.