-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
54 lines (48 loc) · 1.42 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
{
description = "Development environment";
inputs = {
nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
flake-utils = { url = "github:numtide/flake-utils"; };
nix2container = {
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, nixpkgs
, flake-utils
, nix2container
,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
elixir_overlay = (
self: super: rec {
erlang = super.beamMinimal27Packages.erlang;
beamPackages = super.beamMinimal27Packages;
elixir = beamPackages.elixir;
hex = beamPackages.hex.override { inherit elixir; };
rebar3 = beamPackages.rebar3;
buildMix = super.beam.packages.erlang.buildMix'.override { inherit elixir erlang hex; };
}
);
inherit (nixpkgs.lib) optional;
pkgs = import nixpkgs {
inherit system;
overlays = [elixir_overlay];
};
nix2containerPkgs = nix2container.packages.${system};
in
with pkgs; rec {
packages = rec {
pep = callPackage ./default.nix { };
container = callPackage ./container.nix { inherit pep nix2containerPkgs; };
};
defaultPackage = packages.pep;
devShell = callPackage ./shell.nix { };
formatter = nixpkgs-fmt;
}
);
}