feat: elixir
This commit is contained in:
parent
5a43617060
commit
153272ff91
2 changed files with 84 additions and 26 deletions
56
elixir/flake.nix
Normal file
56
elixir/flake.nix
Normal 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);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
description = "nix flakes";
|
description = "nix flakes";
|
||||||
|
|
||||||
outputs =
|
outputs = {self}: {
|
||||||
{ self }:
|
|
||||||
{
|
|
||||||
templates = {
|
templates = {
|
||||||
c = {
|
c = {
|
||||||
path = ./c;
|
path = ./c;
|
||||||
|
|
@ -13,6 +11,10 @@
|
||||||
path = ./go;
|
path = ./go;
|
||||||
description = "go template";
|
description = "go template";
|
||||||
};
|
};
|
||||||
|
elixir = {
|
||||||
|
path = ./elixir;
|
||||||
|
description = "elixir template";
|
||||||
|
};
|
||||||
zig = {
|
zig = {
|
||||||
path = ./zig;
|
path = ./zig;
|
||||||
description = "zig template";
|
description = "zig template";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue