From 5a77cf829a5b00568992e8380e800527f1b0fd24 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Sun, 31 Jul 2022 21:10:16 +0200 Subject: [PATCH] Add elm env --- README.md | 7 ++++++ elm/.envrc | 1 + elm/flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ elm/flake.nix | 25 +++++++++++++++++++++ flake.nix | 5 +++++ 5 files changed, 98 insertions(+) create mode 100644 elm/.envrc create mode 100644 elm/flake.lock create mode 100644 elm/flake.nix diff --git a/README.md b/README.md index 7fe9046..814381f 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,11 @@ The sections below list what each template includes. In all cases, you're free t - [Elixir] 1.13.4, including [mix] and [IEx] - [Node.js][node] 18.7.0 (largely for [Phoenix] projects) +### [`elm`](./elm/) + +- [Elm] 0.19.1 +- [elm2nix] 0.2.1 + ### [`gleam`](./gleam/) - [Gleam] 0.22.1 @@ -171,6 +176,8 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [dhall]: https://dhall-lang.org [dhall-to-nix]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix [elixir]: https://elixir-lang.org +[elm]: https://elm-lang.org +[elm2nix]: https://github.com/cachix/elm2nix [flake-utils]: https://github.com/numtide/flake-utils [gleam]: https://gleam.run [go]: https://go.dev diff --git a/elm/.envrc b/elm/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/elm/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/elm/flake.lock b/elm/flake.lock new file mode 100644 index 0000000..fb87cce --- /dev/null +++ b/elm/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "dev": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1659291915, + "narHash": "sha256-W1on31THSVnqFf/eC8wxP+oGu1jRpFb7K419w21ijNc=", + "owner": "the-nix-way", + "repo": "dev-templates", + "rev": "41e9f202186994255e28bfa4c518e0c9ffce2bb5", + "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": 1659291823, + "narHash": "sha256-8GrIQYelrtzEAXDWdfHpAodwrjL08mVES7nRDXSF9fE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4a778d9b98941fe28f0ac4b8400749a16dbb03fe", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "dev": "dev" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/elm/flake.nix b/elm/flake.nix new file mode 100644 index 0000000..26ff4ff --- /dev/null +++ b/elm/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A Nix-flake-based Protobuf 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) mkShell; + + elm = pkgs.elmPackages.elm; + in { + devShells = { + default = mkShell { + buildInputs = [ elm ] ++ (with pkgs; [ elm2nix ]); + + shellHook = '' + echo "elm `${elm}/bin/elm --version`" + ''; + }; + }; + }); +} diff --git a/flake.nix b/flake.nix index 9898075..5452c97 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,11 @@ description = "Elixir development environment"; }; + elm = { + path = ./elm; + description = "Elm development environment"; + }; + gleam = { path = ./gleam; description = "Gleam development environment";