Add elixir env

This commit is contained in:
Luc Perkins 2022-07-29 00:47:10 +02:00
parent 127ed335af
commit 5c8654b089
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
3 changed files with 78 additions and 0 deletions

1
elixir/.envrc Normal file
View file

@ -0,0 +1 @@
use flake .

42
elixir/flake.lock Normal file
View file

@ -0,0 +1,42 @@
{
"nodes": {
"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": 1659047633,
"narHash": "sha256-zeI+NkJOa665fRrKGpjscfy3Hs4K316q1q7394xbRbw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "496caa738a16d2bb3607243d9127df718bb50513",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

35
elixir/flake.nix Normal file
View file

@ -0,0 +1,35 @@
{
description = "A Nix-flake-based Elixir development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) darwin inotify-tools mkShell nodejs-18_x terminal-notifier;
inherit (pkgs.beam.packages.erlangR25) elixir;
inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isDarwin isLinux;
linuxDeps = optionals isLinux
[ inotify-tools ];
darwinDeps = optionals isDarwin
[ terminal-notifier ] ++ (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]);
in {
devShells = {
default = mkShell {
buildInputs = [ elixir nodejs-18_x ] ++ linuxDeps ++ darwinDeps;
shellHook = ''
${elixir}/bin/mix --version
${elixir}/bin/iex --version
'';
};
};
});
}