-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
45 lines (39 loc) · 1.35 KB
/
flake.nix
File metadata and controls
45 lines (39 loc) · 1.35 KB
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
{
description = "glue-pub — the garden runtime. systemic.engineering on fly.io.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
beam = pkgs.beam.packages.erlang_27;
in {
devShells.default = pkgs.mkShell {
buildInputs = [
beam.erlang
beam.elixir
beam.rebar3
pkgs.git
pkgs.just
pkgs.flyctl
] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
pkgs.libiconv
];
shellHook = ''
export LANG=en_US.UTF-8
# Isolate mix/hex builds in nix store to avoid cross-user permission issues
export MIX_HOME="$PWD/.nix-mix"
export HEX_HOME="$PWD/.nix-hex"
export MIX_BUILD_PATH="$PWD/_build"
export MIX_DEPS_PATH="$PWD/deps"
export PATH="$MIX_HOME/bin:$HEX_HOME/bin:$PATH"
# Ensure owned by current user
mkdir -p "$MIX_HOME" "$HEX_HOME"
mix local.hex --force --if-missing > /dev/null 2>&1
mix local.rebar --force --if-missing > /dev/null 2>&1
'';
};
});
}