diff --git a/README.md b/README.md index 7b5985e..29ba9b0 100644 --- a/README.md +++ b/README.md @@ -69,25 +69,93 @@ The sections below list what each template includes. In all cases, you're free t - [Gleam] 0.22.1 +### [`java`](./java) + +- [Java] 17.0.3 +- [Maven] 3.8.5 +- [Gradle] 7.5 +- [Ant] 1.10.11 + +### [`kotlin`](./kotlin/) + +- [Kotlin] 1.7.10-release-333 +- [Gradle] 7.5 + +### [`nix`](./nix/) + +- [Cachix] +- [dhall-to-nix] 1.1.23 +- [lorri] +- [niv] +- [nixfmt] +- [statix] +- [vulnix] + +### [`node`](./node/) + +- [Node.js][node] 18.7.0 +- [pnpm] 7.3.0 +- [Yarn] 1.22.19 + +### [`protobuf`](./protobuf/) + +- The [Buf CLI][buf] 1.7.0 +- [protoc][protobuf] 3.19.4 + +### [`rust`](./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.6.2 if neither is present + +- [rust-analyzer] 2022-07-11 + +### [`scala`](./scala/) + +- [Scala] 3.1.0 ([Java] 17.0.3) +- [sbt] 1.6.2 + +### [`zig`](./zig/) + +- [Zig] 0.9.1 + ## 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] and [`flake-utils`][flake-utils] to all the templates. +[ant]: https://ant.apache.org +[buf]: https://github.com/bufbuild/buf +[cachix]: https://www.cachix.org +[cargo]: https://doc.rust-lang.org/cargo +[clippy]: https://github.com/rust-lang/rust-clippy [dhall]: https://dhall-lang.org +[dhall-to-nix]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix [elixir]: https://elixir-lang.org [flake-utils]: https://github.com/numtide/flake-utils [gleam]: https://gleam.run [go]: https://go.dev +[gradle]: https://gradle.org [iex]: https://hexdocs.pm/iex/IEx.html [java]: https://java.com [kotlin]: https://kotlinlang.org +[lorri]: https://github.com/target/lorri +[maven]: https://maven.apache.org [mix]: https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html +[niv]: https://github.com/nmattia/niv [nix]: https://nixos.org +[nixfmt]: https://github.com/serokell/nixfmt [nixpkgs]: https://github.com/NixOS/nixpkgs [nix-direnv]: https://github.com/nix-community/nix-direnv [node]: https://nodejs.org [phoenix]: https://phoenixframework.org +[pnpm]: https://pnpm.io [protobuf]: https://developers.google.com/protocol-buffers [rust]: https://rust-lang.org [scala]: https://scala-lang.org +[statix]: https://github.com/nerdypepper/statix +[sbt]: https://www.scala-sbt.org +[vulnix]: https://github.com/flyingcircusio/vulnix +[yarn]: https://yarnpkg.com [zig]: https://ziglang.org diff --git a/java/flake.nix b/java/flake.nix index f6312b2..a397dd0 100644 --- a/java/flake.nix +++ b/java/flake.nix @@ -7,16 +7,16 @@ let inherit (dev.lib) flake-utils nixpkgs; in flake-utils.lib.eachDefaultSystem (system: let - jdk = "jdk17"; + jdk = pkgs.jdk17; config = { packageOverrides = p: { - gradle = (p.gradle.override { java = p.${jdk}; }); + gradle = (p.gradle.override { java = jdk; }); }; }; pkgs = import nixpkgs { inherit config jdk system; }; - java = pkgs.${jdk}; + java = jdk; buildTools = with pkgs; [ ant gradle maven ]; inherit (pkgs) mkShell; in { diff --git a/kotlin/flake.nix b/kotlin/flake.nix index a7b2476..03501f8 100644 --- a/kotlin/flake.nix +++ b/kotlin/flake.nix @@ -7,22 +7,22 @@ let inherit (dev.lib) flake-utils nixpkgs; in flake-utils.lib.eachDefaultSystem (system: let - jdk = "jdk17"; + jdk = pkgs.jdk17; config = { packageOverrides = p: { - gradle = (p.gradle.override { java = p.${jdk}; }); + gradle = (p.gradle.override { java = jdk; }); - kotlin = (p.kotlin.override { jre = p.${jdk}; }); + kotlin = (p.kotlin.override { jre = jdk; }); }; }; pkgs = import nixpkgs { inherit config system; }; + inherit (pkgs) mkShell; + kotlin = pkgs.kotlin; buildTools = with pkgs; [ gradle ]; otherTools = with pkgs; [ gcc ncurses patchelf zlib ]; - - inherit (pkgs) mkShell; in { devShells = { default = mkShell { diff --git a/nix/flake.nix b/nix/flake.nix index 65f0567..0a10cc5 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -9,7 +9,6 @@ let pkgs = import nixpkgs { inherit system; }; - nix = pkgs.nixUnstable; dhallNix = pkgs.haskellPackages.dhall-nix; nixRelatedTools = with pkgs; [ @@ -18,14 +17,12 @@ lorri niv nixfmt - nixpkgs-fmt statix + vulnix ]; inherit (pkgs) mkShell; in { - devShells = { - default = mkShell { buildInputs = [ nix ] ++ nixRelatedTools; }; - }; + devShells = { default = mkShell { buildInputs = nixRelatedTools; }; }; }); } diff --git a/node/flake.nix b/node/flake.nix index 88d914a..189f7a5 100644 --- a/node/flake.nix +++ b/node/flake.nix @@ -11,13 +11,13 @@ inherit (pkgs) mkShell; - nodejs = pkgs.nodejs; + nodejs = pkgs.nodejs-18_x; pnpm = pkgs.nodePackages.pnpm; - yarn = pkgs.yarn; + yarn = (pkgs.yarn.override { inherit nodejs; }); in { devShells = { default = mkShell { - buildInputs = [ nodejs pnpm (yarn.override { inherit nodejs; }) ]; + buildInputs = [ nodejs pnpm yarn ]; shellHook = '' echo "node `${nodejs}/bin/node --version`" diff --git a/rust/flake.nix b/rust/flake.nix index e069385..b6294dc 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -27,8 +27,7 @@ deps = with pkgs; [ openssl pkgconfig ]; rustTools = with pkgs; - [ cargo-profiler rust-analyzer ] - ++ optionals isLinux (with pkgs; [ cargo-watch ]); + [ rust-analyzer ] ++ optionals isLinux (with pkgs; [ cargo-watch ]); in { packages.default = rust; diff --git a/scala/flake.nix b/scala/flake.nix index ad14060..88f8cd9 100644 --- a/scala/flake.nix +++ b/scala/flake.nix @@ -8,7 +8,6 @@ in flake-utils.lib.eachDefaultSystem (system: let jdk = "jdk17"; - jdkPkg = pkgs.${jdk}; config = { packageOverrides = p: { @@ -27,7 +26,7 @@ in { devShells = { default = mkShell { - buildInputs = [ scala jdkPkg ] ++ buildTools; + buildInputs = [ scala ] ++ buildTools; shellHook = '' ${scala}/bin/scala -version