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,9 +1,7 @@
{
description = "nix flakes";
outputs =
{ self }:
{
outputs = {self}: {
templates = {
c = {
path = ./c;
@ -13,6 +11,10 @@
path = ./go;
description = "go template";
};
elixir = {
path = ./elixir;
description = "elixir template";
};
zig = {
path = ./zig;
description = "zig template";