forked from leanprover-community/lean-update
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
48 lines (45 loc) · 1.35 KB
/
Copy pathflake.nix
File metadata and controls
48 lines (45 loc) · 1.35 KB
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
{
description = "lean-update dev shell";
inputs = {
nixpkgs.follows = "lean4-nix/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
lean4-nix.url = "github:argumentcomputer/lean4-nix";
};
outputs =
inputs@{
flake-parts,
lean4-nix,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
perSystem =
{ system, pkgs, ... }:
let
lean = lean4-nix.lib.${system}.fromToolchainFile ./lean-toolchain;
in
{
devShells.default = pkgs.mkShell {
# `gh` and `git` are invoked by the action's subcommands.
packages = [
lean
pkgs.gh
pkgs.git
];
# `IO.Process.lakeOutput` resolves lake through the Elan proxy
# rather than `PATH`, so `lake update` finds nothing in a shell that
# only has lake on `PATH`. CI installs real Elan; here the toolchain
# provides the same `bin/lake` layout that `ELAN_HOME` expects.
#
# Note this pins every package to this toolchain, where Elan would
# honour each package's own `lean-toolchain`.
ELAN_HOME = "${lean}";
};
};
};
}