feat: elixir

This commit is contained in:
Elisiei Yehorov 2026-04-03 18:31:37 +02:00
parent 5a43617060
commit 153272ff91
Signed by: elisiei
GPG key ID: BA1D158DCE3DF089
2 changed files with 84 additions and 26 deletions

56
elixir/flake.nix Normal file
View file

@ -0,0 +1,56 @@
{
description = "minimal flake for elixir dev";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs = {self, ...} @ inputs: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem = f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [inputs.self.overlays.default];
};
}
);
in {
overlays.default = final: prev: rec {
erlang = final.beam.interpreters.erlang_27;
pkgs-beam = final.beam.packagesWith erlang;
elixir = pkgs-beam.elixir_1_17;
};
devShells = forEachSupportedSystem (
{
pkgs,
system,
}: {
default = pkgs.mkShellNoCC {
packages = with pkgs;
[
elixir
self.formatter.${system}
]
++
# Linux only
pkgs.lib.optionals pkgs.stdenv.isLinux (
with pkgs; [
gigalixir
inotify-tools
libnotify
]
);
};
}
);
formatter = forEachSupportedSystem ({pkgs, ...}: pkgs.nixfmt);
};
}

View file

@ -1,32 +1,34 @@
{ {
description = "nix flakes"; description = "nix flakes";
outputs = outputs = {self}: {
{ self }: templates = {
{ c = {
templates = { path = ./c;
c = { description = "c template";
path = ./c; };
description = "c template"; go = {
}; path = ./go;
go = { description = "go template";
path = ./go; };
description = "go template"; elixir = {
}; path = ./elixir;
zig = { description = "elixir template";
path = ./zig; };
description = "zig template"; zig = {
}; path = ./zig;
odin = { description = "zig template";
path = ./odin; };
description = "odin template"; odin = {
}; path = ./odin;
crystal = { description = "odin template";
path = ./crystal; };
description = "crystal template"; crystal = {
}; path = ./crystal;
description = "crystal template";
}; };
defaultTemplate = self.templates.go;
}; };
defaultTemplate = self.templates.go;
};
} }