From 28812f5ae4ef1d13e11458faaadcaa46dbdc8ce0 Mon Sep 17 00:00:00 2001 From: jtomas Date: Wed, 21 Dec 2022 16:04:57 +0100 Subject: [PATCH] add purescript --- README.md | 60 ++++++++++++++++++++++++++----------------- flake.nix | 5 ++++ purescript/.envrc | 1 + purescript/flake.lock | 59 ++++++++++++++++++++++++++++++++++++++++++ purescript/flake.nix | 41 +++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+), 24 deletions(-) create mode 100644 purescript/.envrc create mode 100644 purescript/flake.lock create mode 100644 purescript/flake.nix diff --git a/README.md b/README.md index 8ba11eb..b93dd9e 100644 --- a/README.md +++ b/README.md @@ -27,30 +27,31 @@ Once your preferred template has been initialized, you can use the provided shel ## Available templates -| Language/framework/tool | Template | -| :----------------------- | :------------------------ | -| [Clojure] | [`clojure`](./clojure/) | -| [Cue] | [`cue`](./cue/) | -| [Dhall] | [`dhall`](./dhall/) | -| [Elixir] | [`elixir`](./elixir/) | -| [Elm] | [`elm`](./elm/) | -| [Gleam] | [`gleam`](./gleam/) | -| [Go] | [`go`](./go/) | -| [Hashicorp] tools | [`hashi`](./hashi/) | -| [Java] | [`java`](./java/) | -| [Kotlin] | [`kotlin`](./kotlin/) | -| [Nickel] | [`nickel`](./nickel/) | -| [Nim] | [`nim`](./nim/) | -| [Nix] | [`nix`](./nix/) | -| [Node.js][node] | [`node`](./node/) | -| [OCaml] | [`ocaml`](./ocaml/) | -| [Open Policy Agent][opa] | [`opa`](./opa) | -| [PHP] | [`php`](./php/) | -| [Protobuf] | [`protobuf`](./protobuf/) | -| [Ruby] | [`ruby`](./ruby/) | -| [Rust] | [`rust`](./rust/) | -| [Scala] | [`scala`](./scala/) | -| [Zig] | [`zig`](./zig/) | +| Language/framework/tool | Template | +| :----------------------- | :-----------------------------| +| [Clojure] | [`clojure`](./clojure/) | +| [Cue] | [`cue`](./cue/) | +| [Dhall] | [`dhall`](./dhall/) | +| [Elixir] | [`elixir`](./elixir/) | +| [Elm] | [`elm`](./elm/) | +| [Gleam] | [`gleam`](./gleam/) | +| [Go] | [`go`](./go/) | +| [Hashicorp] tools | [`hashi`](./hashi/) | +| [Java] | [`java`](./java/) | +| [Kotlin] | [`kotlin`](./kotlin/) | +| [Nickel] | [`nickel`](./nickel/) | +| [Nim] | [`nim`](./nim/) | +| [Nix] | [`nix`](./nix/) | +| [Node.js][node] | [`node`](./node/) | +| [OCaml] | [`ocaml`](./ocaml/) | +| [Open Policy Agent][opa] | [`opa`](./opa) | +| [PHP] | [`php`](./php/) | +| [Protobuf] | [`protobuf`](./protobuf/) | +| [Purescript] | [`purescript`](./purescript/) | +| [Ruby] | [`ruby`](./ruby/) | +| [Rust] | [`rust`](./rust/) | +| [Scala] | [`scala`](./scala/) | +| [Zig] | [`zig`](./zig/) | ## Template contents @@ -181,6 +182,13 @@ The sections below list what each template includes. In all cases, you're free t - The [Buf CLI][buf] 1.7.0 - [protoc][protobuf] 3.19.4 +### [`purescript`](./purescript/) + +- [Purescript] +- [Spago] +- [purescript-language-server] +- [purs-tidy] + ### [`python`](./python/) - [Python] 3.11.0rc1 @@ -294,6 +302,9 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [php]: https://php.net/ [pnpm]: https://pnpm.io [protobuf]: https://developers.google.com/protocol-buffers +[Purescript]: https://github.com/purescript/purescript +[purescript-language-server]: https://github.com/nwolverson/purescript-language-server +[purs-tidy]: https://github.com/natefaubion/purescript-tidy [python]: https://python.org [ruby]: https://ruby-lang.org [rust]: https://rust-lang.org @@ -301,6 +312,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [scala]: https://scala-lang.org [statix]: https://github.com/nerdypepper/statix [sbt]: https://www.scala-sbt.org +[Spago]: https://github.com/purescript/spago [terraform]: https://terraform.io [terragrunt]: https://terragrunt.gruntwork.io [tflint]: https://github.com/terraform-linters/tflint diff --git a/flake.nix b/flake.nix index d51ea65..7a21f24 100644 --- a/flake.nix +++ b/flake.nix @@ -100,6 +100,11 @@ description = "Protobuf development environment"; }; + purescript = { + path = ./purescript; + description = "Purescript development environment"; + }; + python = { path = ./python; description = "Python development environment"; diff --git a/purescript/.envrc b/purescript/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/purescript/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/purescript/flake.lock b/purescript/flake.lock new file mode 100644 index 0000000..34addf4 --- /dev/null +++ b/purescript/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "easy-purescript-nix": { + "flake": false, + "locked": { + "lastModified": 1671011575, + "narHash": "sha256-tESal32bcqqdZO+aKnBzc1GoL2mtnaDtj2y7ociCRGA=", + "owner": "justinwoo", + "repo": "easy-purescript-nix", + "rev": "11d3bd58ce6e32703bf69cec04dc7c38eabe14ba", + "type": "github" + }, + "original": { + "owner": "justinwoo", + "repo": "easy-purescript-nix", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1671632759, + "narHash": "sha256-xWpURFJXayfhGImTH8tPgf4hkGTCt0LTFvhKuKPmhvU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9f684b1517a9dc1a456134a26493df7874027dd9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "easy-purescript-nix": "easy-purescript-nix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/purescript/flake.nix b/purescript/flake.nix new file mode 100644 index 0000000..20403fc --- /dev/null +++ b/purescript/flake.nix @@ -0,0 +1,41 @@ +{ + description = "A Nix-flake-based Purescript development environment"; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs"; + easy-purescript-nix = { + url = "github:justinwoo/easy-purescript-nix"; + flake = false; + }; + }; + outputs = + { self + , nixpkgs + , flake-utils + , easy-purescript-nix + }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + easy-ps = import easy-purescript-nix { inherit pkgs; }; + in + { + devShells.default = pkgs.mkShell { + buildInputs = [ + easy-ps.purs + easy-ps.spago + easy-ps.purescript-language-server + easy-ps.purs-tidy + pkgs.nodejs + ]; + shellHook = '' + echo "Purs `${easy-ps.purs}/bin/purs --version`" + echo "Spago `${easy-ps.spago}/bin/spago --version`" + echo "Purescript Language Server `${easy-ps.purescript-language-server}/bin/purescript-language-server --version`" + echo "Purs Tidy `${easy-ps.purs-tidy}/bin/purs-tidy --version`" + echo "Node.js `${pkgs.nodejs}/bin/node --version`" + ''; + }; + }); +}