Skip to content

Instantly share code, notes, and snippets.

@levex
Created April 5, 2023 17:18
Show Gist options
  • Save levex/168e4f169abcf26669ad05d8603f8a3a to your computer and use it in GitHub Desktop.
Save levex/168e4f169abcf26669ad05d8603f8a3a to your computer and use it in GitHub Desktop.
Custom Nix Shell with specific Erlang and Elixir
{ sources ? import ./sources.nix, pkgs ? import sources.nixpkgs { } }:
with pkgs;
let
erlang = pkgs.erlang.override {
version = "26.0-rc2";
sha256 = "1xqzdqniv6af7cajd3agnqdi12n4fy644p8z07k7r24cp1lz7y03";
};
elixir = (beam.packagesWith erlang).elixir.override {
version = "1.14.4";
sha256 = "1dwvln654c85v498f1vymbwh38mij1w2kz3nwf9q5bab5ajk8plr";
};
in buildEnv {
name = "builder";
paths = [
erlang
elixir
];
}
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
inherit (lib) optional optionals;
in mkShell {
buildInputs = [ (import ./elixir.nix { inherit pkgs; }) ];
}
@levex
Copy link
Author

levex commented Apr 5, 2023

[nix-shell:~]$ elixir --version
Erlang/OTP 26 [RELEASE CANDIDATE 2] [erts-14.0] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.14.4 (compiled with Erlang/OTP 26)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment