-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
56 lines (49 loc) · 1.26 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
{
description = "Lake (Lean Make) is a new build system and package manager for Lean 4.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
lean = {
url = "github:leanprover/lean4";
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, flake-utils
, nixpkgs
, lean
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
packageName = "cParser";
src = ./.;
leanPkgs = lean.packages.${system};
project = leanPkgs.buildLeanPackage {
name = packageName;
inherit src;
};
cli = leanPkgs.buildLeanPackage {
name = "cParser.Main";
executableName = "cParser";
deps = [ project ];
linkFlags = pkgs.lib.optional pkgs.stdenv.isLinux "-rdynamic";
inherit src;
};
in
{
packages = project // {
inherit (leanPkgs) lean;
cli = cli.executable;
};
defaultPackage = self.packages.${system}.cli;
apps.cParser = flake-utils.lib.mkApp {
drv = cli.executable;
};
defaultApp = self.apps.${system}.cParser;
inherit (project) devShell;
});
}