-
Notifications
You must be signed in to change notification settings - Fork 18
/
flake.nix
64 lines (62 loc) · 1.6 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
{
description = "Tokenizers";
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
fenix,
}:
flake-utils.lib.eachSystem [
flake-utils.lib.system.x86_64-linux
flake-utils.lib.system.x86_64-darwin
flake-utils.lib.system.aarch64-darwin
flake-utils.lib.system.aarch64-linux
]
(system: let
pkgs = import nixpkgs {inherit system;};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs;
[
act
binutils
clang
elixir_1_15
(fenix.packages."${system}".complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
gcc
libiconv
openssl
pkg-config
]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.Carbon
darwin.apple_sdk.frameworks.AppKit
];
shellHook = ''
mkdir -p .nix-mix
mkdir -p .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-hex
export PATH=$MIX_HOME/bin:$PATH
export PATH=$HEX_HOME/bin:$PATH
export PATH=$MIX_HOME/escripts:$PATH
export ERL_AFLAGS="-kernel shell_history enabled"
'';
};
});
}