-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
76 lines (69 loc) · 1.94 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
inputs.pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
pre-commit-hooks,
}:
flake-utils.lib.eachSystem [
# TODO: Configure your supported system here.
"x86_64-linux"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
]
(
system: let
pkgs = import nixpkgs {
inherit system;
};
# Set the Erlang version
erlangVersion = "erlang_27";
# Set the Elixir version
elixirVersion = "elixir_1_17";
erlang = pkgs.beam.interpreters.${erlangVersion};
elixir = pkgs.beam.packages.${erlangVersion}.${elixirVersion};
elixir-ls = pkgs.beam.packages.${erlangVersion}.elixir-ls;
inherit (pkgs.lib) optional optionals;
fileWatchers = with pkgs; (optional stdenv.isLinux inotify-tools
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreFoundation
CoreServices
]));
in rec {
# TODO: Add your Elixir package
# packages = flake-utils.lib.flattenTree {
# } ;
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
# TODO: Add a linter for Elixir
};
};
};
devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
buildInputs =
[
erlang
elixir
]
++ (with pkgs; [
nodejs
docker-compose
gnumake
watchexec # for test_watch
])
++ fileWatchers;
inherit (self.checks.${system}.pre-commit-check) shellHook;
LANG = "C.UTF-8";
ERL_AFLAGS = "-kernel shell_history enabled";
};
}
);
}