RustCallLean/flake.nix

51 lines
1.2 KiB
Nix

{
description = "RustCallLean";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
lean.url = "github:leanprover/lean4?ref=v4.1.0";
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
lean,
...
} : flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
};
systems = [
"x86_64-linux"
"x86_64-darwin"
];
perSystem = { system, pkgs, ... }: let
leanPkgs = lean.packages.${system};
callee = leanPkgs.buildLeanPackage {
name = "Callee";
roots = [ "Callee" ];
src = ./Callee;
};
common = [
leanPkgs.lean-all
pkgs.libiconv
];
in rec {
packages = {
inherit (leanPkgs) lean iTree stage1 lean-all;
callee = callee.sharedLib;
};
devShells.default = pkgs.mkShell {
CALLEE_PATH = callee.sharedLib;
LEAN_ROOT = leanPkgs.lean-all;
buildInputs = common ++ [
pkgs.rustc
# This is not needed for compilation. It is here for diagnostic purposes
pkgs.rust-bindgen
];
};
};
};
}