add elixir template
This commit is contained in:
22
elixir/flake.nix
Normal file
22
elixir/flake.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
description = "A Nix-flake-based Elixir development environment";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem
|
||||||
|
(system: let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
devShells.default = pkgs.callPackage ./shell.nix {};
|
||||||
|
});
|
||||||
|
}
|
||||||
18
elixir/shell.nix
Normal file
18
elixir/shell.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{pkgs,...}:
|
||||||
|
pkgs.mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.elixir
|
||||||
|
pkgs.elixir-ls
|
||||||
|
pkgs.erlang
|
||||||
|
];
|
||||||
|
shellHook = ''
|
||||||
|
export MIX_HOME=$PWD/.mix
|
||||||
|
export HEX_HOME=$PWD/.hex
|
||||||
|
echo 'Elixir version:'
|
||||||
|
elixir --version
|
||||||
|
echo 'Erlang version:'
|
||||||
|
erl -version
|
||||||
|
echo 'Welcome to Elixir shell!'
|
||||||
|
echo 'Run `iex` to start the interactive shell'
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user