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);
|
||||
};
|
||||
}
|
||||
54
flake.nix
54
flake.nix
|
|
@ -1,32 +1,34 @@
|
|||
{
|
||||
description = "nix flakes";
|
||||
|
||||
outputs =
|
||||
{ self }:
|
||||
{
|
||||
templates = {
|
||||
c = {
|
||||
path = ./c;
|
||||
description = "c template";
|
||||
};
|
||||
go = {
|
||||
path = ./go;
|
||||
description = "go template";
|
||||
};
|
||||
zig = {
|
||||
path = ./zig;
|
||||
description = "zig template";
|
||||
};
|
||||
odin = {
|
||||
path = ./odin;
|
||||
description = "odin template";
|
||||
};
|
||||
crystal = {
|
||||
path = ./crystal;
|
||||
description = "crystal template";
|
||||
};
|
||||
outputs = {self}: {
|
||||
templates = {
|
||||
c = {
|
||||
path = ./c;
|
||||
description = "c template";
|
||||
};
|
||||
go = {
|
||||
path = ./go;
|
||||
description = "go template";
|
||||
};
|
||||
elixir = {
|
||||
path = ./elixir;
|
||||
description = "elixir template";
|
||||
};
|
||||
zig = {
|
||||
path = ./zig;
|
||||
description = "zig template";
|
||||
};
|
||||
odin = {
|
||||
path = ./odin;
|
||||
description = "odin template";
|
||||
};
|
||||
crystal = {
|
||||
path = ./crystal;
|
||||
description = "crystal template";
|
||||
};
|
||||
|
||||
defaultTemplate = self.templates.go;
|
||||
};
|
||||
|
||||
defaultTemplate = self.templates.go;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue