From 7d3513701fe1ce8e28be0c7ccb8cc491f93d685a Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 1 Aug 2022 00:00:58 +0200 Subject: [PATCH] Add Haskell env --- README.md | 10 +++++++- cue/flake.nix | 2 +- elm/flake.nix | 2 +- flake.nix | 5 ++++ haskell/.envrc | 1 + haskell/flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++ haskell/flake.nix | 24 +++++++++++++++++++ nim/flake.nix | 2 +- opa/flake.nix | 2 +- python/flake.nix | 2 +- ruby/flake.nix | 2 +- 11 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 haskell/.envrc create mode 100644 haskell/flake.lock create mode 100644 haskell/flake.nix diff --git a/README.md b/README.md index 1daed53..e7a61d1 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Once your preferred template has been initialized, you can use the provided shel | [Cue] | [`cue`](./cue/) | | [Dhall] | [`dhall`](./dhall/) | | [Elixir] | [`elixir`](./elixir/) | +| [Elm] | [`elm`](./elm/) | | [Gleam] | [`gleam`](./gleam/) | | [Go] 1.17 | [`go1_17`](./go1.17/) | | [Go] 1.18 | [`go1_18`](./go1.18/) | @@ -109,6 +110,11 @@ The sections below list what each template includes. In all cases, you're free t - [damon] - [Terragrunt] 0.37.0 +### [`haskell`](./haskell/) + +- [GHC][haskell] 9.0.2 +- [cabal] 3.6.2.0 + ### [`java`](./java) - [Java] 17.0.3 @@ -191,6 +197,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [ant]: https://ant.apache.org [buf]: https://github.com/bufbuild/buf +[cabal]: https://www.haskell.org/cabal [cachix]: https://www.cachix.org [cargo]: https://doc.rust-lang.org/cargo [cargo-audit]: https://crates.io/crates/cargo-audit @@ -211,7 +218,8 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [goimports]: https://pkg.go.dev/golang.org/x/tools/cmd/goimports [golangci-lint]: https://github.com/golangci/golangci-lint [gradle]: https://gradle.org -[hashicorp]: https://hashicorp.com/ +[hashicorp]: https://hashicorp.com +[haskell]: https://haskell.org [iex]: https://hexdocs.pm/iex/IEx.html [java]: https://java.com [kotlin]: https://kotlinlang.org diff --git a/cue/flake.nix b/cue/flake.nix index 1a63f23..9afbf7e 100644 --- a/cue/flake.nix +++ b/cue/flake.nix @@ -1,5 +1,5 @@ { - description = "A Nix-flake-based Dhall development environment"; + description = "A Nix-flake-based Cue development environment"; inputs = { dev.url = "github:the-nix-way/dev-templates"; }; diff --git a/elm/flake.nix b/elm/flake.nix index 26ff4ff..39237bd 100644 --- a/elm/flake.nix +++ b/elm/flake.nix @@ -1,5 +1,5 @@ { - description = "A Nix-flake-based Protobuf development environment"; + description = "A Nix-flake-based Elm development environment"; inputs = { dev.url = "github:the-nix-way/dev-templates"; }; diff --git a/flake.nix b/flake.nix index e3ba3fb..07bae67 100644 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,11 @@ description = "HashiCorp DevOps tools development environment"; }; + haskell = { + path = ./haskell; + description = "Haskell development environment"; + }; + java = { path = ./java; description = "Java development environment"; diff --git a/haskell/.envrc b/haskell/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/haskell/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/haskell/flake.lock b/haskell/flake.lock new file mode 100644 index 0000000..e4a5502 --- /dev/null +++ b/haskell/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "dev": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1659301425, + "narHash": "sha256-ws9jVuS3XKx5nYITvSGnMDj8y+JLu7W4ZLWgSoaWDG0=", + "owner": "the-nix-way", + "repo": "dev-templates", + "rev": "34bf508a971639577be4ac3fc422897d380c5086", + "type": "github" + }, + "original": { + "owner": "the-nix-way", + "repo": "dev-templates", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1659300577, + "narHash": "sha256-mTlKMvvBJ4W32Y9VdEXATyMDUWEYVO4P9IWo8Mzn3rM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b91029be03d836b5ab33042aaf0167f02221c1ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "dev": "dev" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/haskell/flake.nix b/haskell/flake.nix new file mode 100644 index 0000000..071cf05 --- /dev/null +++ b/haskell/flake.nix @@ -0,0 +1,24 @@ +{ + description = "A Nix-flake-based Haskell development environment"; + + inputs = { dev.url = "github:the-nix-way/dev-templates"; }; + + outputs = { self, dev }: + let inherit (dev.lib) flake-utils nixpkgs; + in flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + inherit (pkgs) cabal-install ghc mkShell; + in { + devShells = { + default = mkShell { + buildInputs = [ cabal-install ghc ]; + + shellHook = '' + ${ghc}/bin/ghc --version + ${cabal-install}/bin/cabal --version + ''; + }; + }; + }); +} diff --git a/nim/flake.nix b/nim/flake.nix index c84eccb..1623b9d 100644 --- a/nim/flake.nix +++ b/nim/flake.nix @@ -1,5 +1,5 @@ { - description = "A Nix-flake-based Protobuf development environment"; + description = "A Nix-flake-based Nim development environment"; inputs = { dev.url = "github:the-nix-way/dev-templates"; }; diff --git a/opa/flake.nix b/opa/flake.nix index d9d12c8..09d2d58 100644 --- a/opa/flake.nix +++ b/opa/flake.nix @@ -1,5 +1,5 @@ { - description = "A Nix-flake-based Protobuf development environment"; + description = "A Nix-flake-based Open Policy Agent development environment"; inputs = { dev.url = "github:the-nix-way/dev-templates"; }; diff --git a/python/flake.nix b/python/flake.nix index 16553d4..6059635 100644 --- a/python/flake.nix +++ b/python/flake.nix @@ -1,5 +1,5 @@ { - description = "A Nix-flake-based Protobuf development environment"; + description = "A Nix-flake-based Python development environment"; inputs = { dev.url = "github:the-nix-way/dev-templates"; diff --git a/ruby/flake.nix b/ruby/flake.nix index a76e166..8b795f6 100644 --- a/ruby/flake.nix +++ b/ruby/flake.nix @@ -1,5 +1,5 @@ { - description = "A Nix-flake-based Protobuf development environment"; + description = "A Nix-flake-based Ruby development environment"; inputs = { dev.url = "github:the-nix-way/dev-templates"; };