Update Elixir template to use overlay

This commit is contained in:
Daniel Flanagan 2024-04-12 10:20:53 -05:00
parent d3996bb9e2
commit 0225aa2010

View file

@ -20,7 +20,22 @@
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = system: import nixpkgs {inherit system;}; overlay = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_26;
erlang = final.erlangPackages.erlang;
elixir = final.erlangPackages.elixir_1_16;
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
nixpkgsFor = system: ((import nixpkgs {inherit system;}).extend overlay);
in { in {
packages = forAllSystems (system: let packages = forAllSystems (system: let
pkgs = nixpkgsFor system; pkgs = nixpkgsFor system;
@ -49,17 +64,14 @@
devShells = forAllSystems (system: let devShells = forAllSystems (system: let
pkgs = nixpkgsFor system; pkgs = nixpkgsFor system;
erlang = pkgs.beam.packages.erlang_26;
elixir = erlang.elixir_1_16;
in { in {
default = pkgs.mkShell { default = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive"; shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
inotify-tools
erlang_26
erlang
elixir-ls
elixir elixir
elixir-ls
inotify-tools
]; ];
}; };
}); });