-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
52 lines (50 loc) · 1.34 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
{
inputs = {
lean = {
url = "github:leanprover/lean4/v4.0.0-m5";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, lean, flake-utils, nixpkgs }:
let
supportedSystems = [
"aarch64-linux"
"aarch64-darwin"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
inherit (flake-utils) lib;
in
lib.eachSystem supportedSystems (system:
let
leanPkgs = lean.packages.${system};
pkgs = nixpkgs.legacyPackages.${system};
name = "YatimaStdLib"; # must match the name of the top-level .lean file
project = leanPkgs.buildLeanPackage {
inherit name;
# deps = [ lean-ipld.project.${system} ];
# Where the lean files are located
src = ./.;
};
in
{
inherit project;
packages = project // {
${name} = project.sharedLib;
};
defaultPackage = self.packages.${system}.${name};
devShell = pkgs.mkShell {
inputsFrom = [ project.executable ];
buildInputs = with pkgs; [
leanPkgs.lean-dev
];
LEAN_PATH = "./src:./test";
LEAN_SRC_PATH = "./src:./test";
};
});
}