-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (55 loc) · 1.67 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
{
description = "A development tool for running commands with maximum possible concurrency.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pname = "build_pipeline";
version = "0.0.14";
pkgs = import nixpkgs {inherit system;};
beamPackages = pkgs.beam.packages.erlang_25;
elixir = beamPackages.elixir_1_14;
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
in {
# `nix develop`.
devShells = {
default = pkgs.mkShell {
packages = [
elixir
];
};
};
# `nix fmt`.
formatter = pkgs.alejandra;
# `nix build`.
packages = {
build-pipeline = beamPackages.mixRelease {
inherit pname src version;
mixFodDeps = beamPackages.fetchMixDeps {
inherit pname src version;
hash = "sha256-H7yiBHoxuiqWcNbWwPU5X0Nnv8f6nM8z/ZAfZAGPZjE=";
mixEnv = "prod";
};
postBuild = ''
env MIX_ENV=prod mix escript.build
'';
postInstall = ''
# Install the `bp` escript.
mkdir -p $out/bin
cp bp $out/bin/bp
wrapProgram $out/bin/bp \
--prefix PATH : ${pkgs.lib.makeBinPath [beamPackages.erlang]}
# Clean up the Mix release stuff, most of which we don't need.
rm -r $out/{lib,releases,erts-*,bin/build_pipeline}
'';
};
default = self.packages.${system}.build-pipeline;
};
});
}