dev-templates/README.md

374 lines
12 KiB
Markdown
Raw Permalink Normal View History

2022-07-12 01:17:54 +02:00
# Nix flake templates for easy dev environments
2022-07-31 19:53:02 +02:00
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
2022-07-29 02:22:04 +02:00
To initialize (where `${ENV}` is listed in the table below):
```shell
nix flake init --template github:the-nix-way/dev-templates#${ENV}
```
Here's an example (for the [`rust`](./rust) template):
```shell
2022-07-31 17:05:20 +02:00
# Initialize in the current project
2022-07-29 02:22:04 +02:00
nix flake init --template github:the-nix-way/dev-templates#rust
2022-07-31 17:05:20 +02:00
# Create a new project
nix flake new --template github:the-nix-way/dev-templates#rust ${NEW_PROJECT_DIRECTORY}
2022-07-29 02:22:04 +02:00
```
2022-07-31 17:05:20 +02:00
## 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 installed, you can initialize the environment by running `direnv allow`.
2022-07-31 17:05:20 +02:00
2. If you don't have `nix-direnv` installed, you can run `nix develop` to open up the Nix-defined shell.
## Available templates
2022-07-29 02:22:04 +02:00
| Language/framework/tool | Template |
| :--------------------------- | :--------------------------- |
| [Clojure][Clojure] | [`clojure`](./clojure/) |
| [C#][csharp] | [`csharp`](./csharp/) |
| [Cue][Cue] | [`cue`](./cue/) |
| [Dhall][Dhall] | [`dhall`](./dhall/) |
| [Elixir][Elixir] | [`elixir`](./elixir/) |
| [Elm][Elm] | [`elm`](./elm/) |
| Empty (change at will) | [`empty`](./empty) |
| [Gleam][Gleam] | [`gleam`](./gleam/) |
| [Go][Go] | [`go`](./go/) |
| [Hashicorp][Hashicorp] tools | [`hashi`](./hashi/) |
| [Haxe][Haxe] | [`haxe`](./haxe/) |
| [Java][Java] | [`java`](./java/) |
| [Jupyter] | [`jupyter`](./jupyter/) |
| [Kotlin][Kotlin] | [`kotlin`](./kotlin/) |
| [LaTeX][LaTeX] | [`latex`](./latex/) |
| [Nickel][Nickel] | [`nickel`](./nickel/) |
| [Nim][Nim] | [`nim`](./nim/) |
| [Nix][Nix] | [`nix`](./nix/) |
| [Node.js][node] | [`node`](./node/) |
| [OCaml][OCaml] | [`ocaml`](./ocaml/) |
| [Open Policy Agent][opa] | [`opa`](./opa) |
| [PHP][PHP] | [`php`](./php/) |
| [Protobuf][Protobuf] | [`protobuf`](./protobuf/) |
| [Pulumi][Pulumi] | [`pulumi`](./pulumi/) |
| [Purescript][Purescript] | [`purescript`](./purescript/) |
| [Ruby][Ruby] | [`ruby`](./ruby/) |
| [Rust][Rust] | [`rust`](./rust/) |
| [RustPython][Rust] | [`rustpython`](./rustpython/) |
| [Scala][Scala] | [`scala`](./scala/) |
| [Shell] | [`shell`](./shell/) |
| [Vlang][Vlang] | [`vlang`](./vlang/) |
| [Zig][Zig] | [`zig`](./zig/) |
2022-07-29 02:17:49 +02:00
2022-07-31 17:05:20 +02:00
## Template contents
2022-07-31 17:13:00 +02:00
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.
2022-07-31 17:05:20 +02:00
2022-08-04 10:19:10 +02:00
### [`clojure`](./clojure/)
- [Clojure][Clojure] 1.11.1.1347
- [Boot][Boot] 2.8.3
- [Leiningen][Leiningen] 2.10.0
2022-08-04 10:19:10 +02:00
2023-05-25 21:23:06 +02:00
### [`csharp`](./csharp/)
- [dotnet][dotnet] sdk 7 (7.0.305)
- [omnisharp-roslyn][omnisharp-roslyn]
- [Mono][Mono] 6.12.0.182
- [msbuild][msbuild] 16.10.1
2023-05-25 21:23:06 +02:00
2022-07-31 20:23:05 +02:00
### [`cue`](./cue/)
- [Cue][Cue] 0.5.0
2022-07-31 20:23:05 +02:00
2022-07-31 17:13:00 +02:00
### [`dhall`](./dhall)
2022-07-31 17:05:20 +02:00
- [Dhall][Dhall] 1.41.2
- [dhall-bash][dhall-bash]
- [dhall-docs][dhall-docs]
- [dhall-json][dhall-json]
- [dhall-lsp-server][dhall-lsp-server]
- [dhall-nix][dhall-nix]
- [dhall-nixpkgs][dhall-nixpkgs]
- [dhall-openapi][dhall-openapi]
- [dhall-toml][dhall-toml]
- [dhall-yaml][dhall-yaml]
2022-07-31 17:05:20 +02:00
2022-07-31 17:13:00 +02:00
### [`elixir`](./elixir/)
- [Elixir][Elixir] 1.14.5, including [mix][mix] and [IEx][IEx]
- [gigalixir][gigalixir] (Linux only)
2022-07-31 17:13:00 +02:00
2022-07-31 21:10:16 +02:00
### [`elm`](./elm/)
- [Elm][Elm] 0.19.1
- [elm2nix][elm2nix]
2022-07-31 21:10:16 +02:00
2024-04-25 12:26:02 +02:00
### [Empty](./empty/)
A dev template that's fully customizable.
2022-07-31 17:13:00 +02:00
### [`gleam`](./gleam/)
- [Gleam][Gleam] 0.30.0
2022-07-31 17:13:00 +02:00
### [`go`](./go/)
2022-07-31 18:02:44 +02:00
- [Go][Go] 1.20.5
- Standard Go tools ([goimports][goimports], [godoc][godoc], and others)
- [golangci-lint][golangci-lint]
2022-07-31 18:02:44 +02:00
2022-07-31 18:11:52 +02:00
### [`hashi`](./hashi/)
- [Packer][Packer] 1.8.6
- [Terraform][Terraform] 1.5.2
- [Nomad][Nomad] 1.4.6
- [Vault][Vault] 1.13.3
- [nomad-autoscaler][nomad-autoscaler] 0.3.6-dev
- [nomad-pack][nomad-pack] 0.0.1-techpreview.3
- [levant][levant] 0.3.2-dev
- [damon][damon]
- [Terragrunt][Terragrunt] 0.45.13
- [tflint][tflint] 0.46.1
2022-07-31 18:11:52 +02:00
2022-08-01 00:00:58 +02:00
### [`haskell`](./haskell/)
2023-07-14 02:52:19 +02:00
- [GHC][haskell] 9.2.8
- [cabal][cabal] 3.10.1.0
2022-08-01 00:00:58 +02:00
2024-04-25 12:26:02 +02:00
### [`haxe`](./haxe/)
- [Haxe][Haxe] 4.2.5
2024-04-25 12:26:02 +02:00
2022-07-31 17:59:22 +02:00
### [`java`](./java)
- [Java][Java] 20.0.1+9
- [Maven][Maven] 3.9.2
- [Gradle][Gradle] 9.0.1
- [jdtls][jdtls] 1.31.0
2022-07-31 17:59:22 +02:00
### [`kotlin`](./kotlin/)
- [Kotlin][Kotlin] 1.9.0
- [Gradle][Gradle] 8.0.1
2022-07-31 17:59:22 +02:00
### [`latex`](./latex/)
- [texlive][texlive]
- [tectonic][tectonic]
- [texlab][texlab]
2022-08-01 03:04:16 +02:00
### [`nickel`](./nickel/)
- [Nickel][Nickel] 0.2.0
2022-08-01 03:04:16 +02:00
2022-07-31 21:01:58 +02:00
### [`nim`](./nim)
- [Nim][Nim] 1.6.14
- [nimble][nimble] 0.14.2
2022-07-31 21:01:58 +02:00
2022-07-31 17:59:22 +02:00
### [`nix`](./nix/)
- [Cachix][Cachix] 1.6
- [dhall-to-nix][dhall-to-nix] 1.1.25
- [lorri][lorri] 1.6.0
- [niv][niv] 0.2.22
- [nixfmt][nixfmt] 0.5.0
- [statix][statix] 0.5.6
- [vulnix][vulnix]
2022-07-31 17:59:22 +02:00
### [`node`](./node/)
2023-07-14 02:52:19 +02:00
- [Node.js][node] 18.16.1
- [npm][npm] 9.5.1
- [pnpm][pnpm] 8.6.6
- [Yarn][Yarn] 1.22.19
- [node2nix][node2nix] 1.11.1
2022-07-31 17:59:22 +02:00
2022-08-13 17:10:46 +02:00
### [`ocaml`](./ocaml/)
- [OCaml][OCaml] 4.14.1
- [Dune][Dune] 3.9.1
- [odoc][odoc] 2.2.0
- [ocamlformat][ocamlformat] 0.25.1
2022-08-13 17:10:46 +02:00
2022-07-31 21:59:08 +02:00
### [`opa`](./opa/)
2023-07-14 02:52:19 +02:00
- [Open Policy Agent][opa] 0.54.0
- [Conftest][Conftest] 0.44.0
2022-07-31 21:59:08 +02:00
2022-09-28 09:34:13 +02:00
### [`php`](./php/)
- [PHP][PHP] 8.2.8
- [Composer][Composer] 2.5.8
2022-09-28 09:34:13 +02:00
2022-07-31 17:59:22 +02:00
### [`protobuf`](./protobuf/)
2023-07-14 02:52:19 +02:00
- The [Buf CLI][buf] 1.23.1
- [protoc][protobuf] 3.21.12
2022-07-31 17:59:22 +02:00
2023-07-14 00:53:11 +02:00
### [`pulumi`](./pulumi/)
- [Pulumi][Pulumi] 3.72.1
- [Python][Python] 3.11.4
- [Go][Go] 1.20.5
2023-07-14 00:53:11 +02:00
- [Node.js][node] 18.16.1
- [dotnet][dotnet] sdk 6
- [Java][Java] 19.0.1 and [Maven][Maven] 3.9.2
- [jq][jq] 1.6
2023-07-14 00:53:11 +02:00
2022-12-21 16:04:57 +01:00
### [`purescript`](./purescript/)
- [Purescript][Purescript] (purs) 0.15.9
- [Spago][Spago] 0.21.0
- [purescript-language-server][purescript-language-server] 0.17.1
- [purs-tidy][purs-tidy] 0.10.0
2022-12-21 16:04:57 +01:00
2022-07-31 22:33:11 +02:00
### [`python`](./python/)
- [Python][Python] 3.11.4
- [pip][pip] 23.0.1
2022-07-31 22:33:11 +02:00
2022-07-31 22:18:29 +02:00
### [`ruby`](./ruby/)
- [Ruby][Ruby] 3.2.2, plus the standard Ruby tools (`bundle`, `gem`, etc.)
2022-07-31 22:18:29 +02:00
2022-07-31 17:59:22 +02:00
### [`rust`](./rust/)
- [Rust][Rust], including [cargo][cargo], [Clippy][Clippy], and the other standard tools. The Rust version is determined as follows, in order:
2022-07-31 17:59:22 +02:00
- From the `rust-toolchain.toml` file if present
- From the `rust-toolchain` file if present
2023-07-14 02:52:19 +02:00
- Version 1.70.0 if neither is present
- [rust-analyzer][rust-analyzer] 2023-07-10
- [cargo-audit][cargo-audit] 0.17.0
- [cargo-deny][cargo-deny] 0.12.1
2022-07-31 17:59:22 +02:00
### [`scala`](./scala/)
- [Scala][Scala] 2.13.11 ([Java][Java] 19.0.1)
- [sbt][sbt] 1.9.2
2022-07-31 17:59:22 +02:00
### [`shell`](./shell/)
- [shellcheck][shellcheck] 0.9.0
2024-04-25 12:26:02 +02:00
### [`Vlang`](./vlang/)
- [Vlang][Vlang] 0.4.4
2024-04-25 12:26:02 +02:00
2022-07-31 17:59:22 +02:00
### [`zig`](./zig/)
- [Zig][Zig] 0.10.1
2022-07-31 17:59:22 +02:00
2022-07-31 17:13:00 +02:00
## Code organization
All of the templates have only the root [flake](./flake.nix) as a flake input. That root flake provides a common revision of [Nixpkgs][Nixpkgs] and to all the templates.
2022-07-31 17:13:00 +02:00
2022-08-04 10:26:16 +02:00
[boot]: https://www.boot-clj.com
2022-07-31 17:59:22 +02:00
[buf]: https://github.com/bufbuild/buf
2022-08-01 00:00:58 +02:00
[cabal]: https://www.haskell.org/cabal
2022-07-31 17:59:22 +02:00
[cachix]: https://www.cachix.org
[cargo]: https://doc.rust-lang.org/cargo
2022-07-31 22:47:19 +02:00
[cargo-audit]: https://crates.io/crates/cargo-audit
[cargo-deny]: https://crates.io/crates/cargo-deny
2022-07-31 17:59:22 +02:00
[clippy]: https://github.com/rust-lang/rust-clippy
2022-08-04 10:19:10 +02:00
[clojure]: https://clojure.org
2022-09-28 09:34:13 +02:00
[composer]: https://getcomposer.org/
2022-08-02 02:58:25 +02:00
[conftest]: https://www.conftest.dev
2023-05-25 21:23:06 +02:00
[csharp]: https://dotnet.microsoft.com/en-us/languages/csharp
2022-07-31 20:23:05 +02:00
[cue]: https://cuelang.org
2022-07-31 18:20:01 +02:00
[damon]: https://github.com/hashicorp/damon
2022-07-29 02:17:49 +02:00
[dhall]: https://dhall-lang.org
2022-08-05 11:10:37 +02:00
[dhall-bash]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-bash
[dhall-docs]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-docs
[dhall-json]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-json
[dhall-lsp-server]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server
[dhall-nix]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix
[dhall-nixpkgs]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nixpkgs
[dhall-openapi]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-openapi
2022-07-31 17:59:22 +02:00
[dhall-to-nix]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix
2022-08-05 11:10:37 +02:00
[dhall-toml]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-toml
[dhall-yaml]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-yaml
2023-05-25 21:23:06 +02:00
[dotnet]: https://dotnet.microsoft.com/en-us/
2022-08-13 17:10:46 +02:00
[dune]: https://dune.build
2022-07-29 02:17:49 +02:00
[elixir]: https://elixir-lang.org
2022-07-31 21:10:16 +02:00
[elm]: https://elm-lang.org
[elm2nix]: https://github.com/cachix/elm2nix
2022-07-31 17:13:00 +02:00
[flake-utils]: https://github.com/numtide/flake-utils
2022-08-02 12:57:37 +02:00
[gigalixir]: https://www.gigalixir.com
2022-07-29 02:17:49 +02:00
[gleam]: https://gleam.run
[go]: https://go.dev
2022-07-31 18:02:44 +02:00
[godoc]: https://pkg.go.dev/golang.org/x/tools/cmd/godoc
[goimports]: https://pkg.go.dev/golang.org/x/tools/cmd/goimports
[golangci-lint]: https://github.com/golangci/golangci-lint
2022-07-31 17:59:22 +02:00
[gradle]: https://gradle.org
2022-08-01 00:00:58 +02:00
[hashicorp]: https://hashicorp.com
[haskell]: https://haskell.org
2024-04-25 12:26:02 +02:00
[haxe]: https://haxe.org/
2022-07-31 17:13:00 +02:00
[iex]: https://hexdocs.pm/iex/IEx.html
2022-07-29 02:17:49 +02:00
[java]: https://java.com
2024-04-25 12:26:02 +02:00
[jdtls]: https://projects.eclipse.org/projects/eclipse.jdt.ls
2023-07-14 00:53:11 +02:00
[jq]: https://jqlang.github.io/jq
2022-07-29 02:17:49 +02:00
[kotlin]: https://kotlinlang.org
[latex]: https://www.latex-project.org/
2022-08-04 10:19:10 +02:00
[leiningen]: https://leiningen.org
2022-07-31 18:20:01 +02:00
[levant]: https://github.com/hashicorp/levant
2022-07-31 17:59:22 +02:00
[lorri]: https://github.com/target/lorri
[maven]: https://maven.apache.org
2022-07-31 17:13:00 +02:00
[mix]: https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html
2023-05-25 21:23:06 +02:00
[mono]: https://www.mono-project.com/
[msbuild]: https://github.com/dotnet/msbuild
2022-08-01 03:04:16 +02:00
[nickel]: https://nickel-lang.org
2022-07-31 21:01:58 +02:00
[nim]: https://nim-lang.org
[nimble]: https://github.com/nim-lang/nimble
2022-07-31 17:59:22 +02:00
[niv]: https://github.com/nmattia/niv
2022-07-29 02:17:49 +02:00
[nix]: https://nixos.org
2022-07-31 17:59:22 +02:00
[nixfmt]: https://github.com/serokell/nixfmt
2022-07-31 17:13:00 +02:00
[nixpkgs]: https://github.com/NixOS/nixpkgs
2022-07-31 17:05:20 +02:00
[nix-direnv]: https://github.com/nix-community/nix-direnv
2022-07-29 02:17:49 +02:00
[node]: https://nodejs.org
2022-08-02 12:50:59 +02:00
[node2nix]: https://github.com/svanderburg/node2nix
2022-07-31 18:20:01 +02:00
[nomad]: https://nomadproject.io
2022-08-13 17:37:24 +02:00
[nomad-autoscaler]: https://github.com/hashicorp/nomad-autoscaler
2022-07-31 18:20:01 +02:00
[nomad-pack]: https://github.com/hashicorp/nomad-pack
2022-08-03 08:35:52 +02:00
[npm]: https://npmjs.org
2022-08-13 17:10:46 +02:00
[ocaml]: https://ocaml.org
[ocamlformat]: https://github.com/ocaml-ppx/ocamlformat
[odoc]: https://github.com/ocaml/odoc
2023-05-25 21:23:06 +02:00
[omnisharp-roslyn]: https://github.com/OmniSharp/omnisharp-roslyn
2022-07-31 21:59:08 +02:00
[opa]: https://openpolicyagent.org
2022-07-31 18:11:52 +02:00
[packer]: https://packer.io
2022-07-31 22:33:11 +02:00
[pip]: https://pypi.org/project/pip
2022-07-31 17:13:00 +02:00
[phoenix]: https://phoenixframework.org
2022-09-28 09:34:13 +02:00
[php]: https://php.net/
2022-07-31 17:59:22 +02:00
[pnpm]: https://pnpm.io
2022-07-29 02:49:09 +02:00
[protobuf]: https://developers.google.com/protocol-buffers
2023-07-14 00:53:11 +02:00
[pulumi]: https://pulumi.com/
[purescript]: https://github.com/purescript/purescript
2022-12-21 16:04:57 +01:00
[purescript-language-server]: https://github.com/nwolverson/purescript-language-server
[purs-tidy]: https://github.com/natefaubion/purescript-tidy
2022-07-31 22:33:11 +02:00
[python]: https://python.org
2023-03-06 12:28:29 +01:00
[release]: https://github.com/NixOS/nixpkgs/releases/tag/22.11
2022-07-31 22:18:29 +02:00
[ruby]: https://ruby-lang.org
2022-07-29 02:17:49 +02:00
[rust]: https://rust-lang.org
2022-08-02 02:58:25 +02:00
[rust-analyzer]: https://rust-analyzer.github.io
2022-07-29 02:17:49 +02:00
[scala]: https://scala-lang.org
[shellcheck]: https://www.shellcheck.net/
2022-07-31 17:59:22 +02:00
[statix]: https://github.com/nerdypepper/statix
[sbt]: https://www.scala-sbt.org
2023-03-06 12:28:29 +01:00
[spago]: https://github.com/purescript/spago
[tectonic]: https://tectonic-typesetting.github.io/
2022-07-31 18:11:52 +02:00
[terraform]: https://terraform.io
[terragrunt]: https://terragrunt.gruntwork.io
[texlab]: https://github.com/latex-lsp/texlab
[texlive]: https://www.tug.org/texlive/
2022-08-23 14:42:54 +02:00
[tflint]: https://github.com/terraform-linters/tflint
2022-08-13 17:32:28 +02:00
[vault]: https://www.vaultproject.io
2022-07-31 17:59:22 +02:00
[vulnix]: https://github.com/flyingcircusio/vulnix
[yarn]: https://yarnpkg.com
2024-04-25 12:26:02 +02:00
[vlang]: https://vlang.io/
2022-07-29 02:17:49 +02:00
[zig]: https://ziglang.org