Skip to content

Commit 93106a7

Browse files
committed
fix: Frontend and src
* Use fenix for rust toolchain
1 parent 534a02f commit 93106a7

File tree

3 files changed

+135
-60
lines changed

3 files changed

+135
-60
lines changed

Yatima/Compiler.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import Yatima.Compiler.FromLean
1+
import Yatima.Compiler.Frontend

flake.lock

Lines changed: 97 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,38 @@
33

44
inputs = {
55
lean = {
6-
url = github:leanprover/lean4;
6+
url = "github:leanprover/lean4/v4.0.0-m5";
77
inputs.flake-utils.follows = "flake-utils";
88
inputs.nixpkgs.follows = "nixpkgs";
99
};
1010
ipld = {
11-
url = github:yatima-inc/Ipld.lean;
11+
url = "github:yatima-inc/Ipld.lean";
1212
inputs.lean.follows = "lean";
1313
inputs.nixpkgs.follows = "nixpkgs";
1414
};
15-
16-
nixpkgs.url = github:nixos/nixpkgs/nixos-21.11;
15+
yatima-std = {
16+
# url = "github:yatima-inc/YatimaStdLib.lean";
17+
url = "github:anderssorby/YatimaStdLib.lean/acs/add-flake";
18+
inputs.lean.follows = "lean";
19+
inputs.nixpkgs.follows = "nixpkgs";
20+
};
21+
nixpkgs.url = "nixpkgs/nixos-unstable";
1722
naersk = {
1823
url = github:nix-community/naersk;
1924
inputs.flake-utils.follows = "flake-utils";
2025
inputs.nixpkgs.follows = "nixpkgs";
2126
};
2227
flake-utils = {
23-
url = github:numtide/flake-utils;
28+
url = "github:numtide/flake-utils";
2429
inputs.nixpkgs.follows = "nixpkgs";
2530
};
26-
utils = {
27-
url = github:yatima-inc/nix-utils;
28-
inputs.flake-utils.follows = "flake-utils";
31+
fenix = {
32+
url = "github:nix-community/fenix";
2933
inputs.nixpkgs.follows = "nixpkgs";
30-
inputs.naersk.follows = "naersk";
3134
};
3235
};
3336

34-
outputs = { self, lean, flake-utils, utils, nixpkgs, naersk, ipld }:
37+
outputs = { self, lean, flake-utils, nixpkgs, naersk, ipld, yatima-std, fenix }:
3538
let
3639
supportedSystems = [
3740
# "aarch64-linux"
@@ -45,19 +48,38 @@
4548
let
4649
leanPkgs = lean.packages.${system};
4750
pkgs = nixpkgs.legacyPackages.${system};
48-
lib = utils.lib.${system};
49-
inherit (lib) buildRustProject getRust;
50-
rustNightly = getRust { date = "2022-05-12"; sha256 = "sha256-ttn4r8k3yzreTgsMSJAg37uZWHuZBPUDsBhJDkASyWM="; };
51+
rust = fenix.packages.${system}.complete;
52+
inherit (rust) cargo rustc;
53+
# Get a naersk with the input rust version
54+
naerskWithRust = rust: naersk.lib."${system}".override {
55+
inherit (rust) cargo rustc;
56+
};
57+
env = with pkgs; {
58+
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
59+
};
60+
# Naersk using the default rust version
61+
buildRustProject = pkgs.makeOverridable ({ naersk ? naerskWithRust rust, ... } @ args: with pkgs; naersk.buildPackage ({
62+
buildInputs = [
63+
clang
64+
pkg-config
65+
] ++ lib.optionals stdenv.isDarwin [
66+
darwin.apple_sdk.frameworks.Security
67+
];
68+
copyLibs = true;
69+
copyBins = true;
70+
targets = [ ];
71+
remapPathPrefix =
72+
true; # remove nix store references for a smaller output package
73+
} // env // args));
5174
yatima-rs = buildRustProject {
52-
rust = rustNightly;
5375
src = ./yatima-rs;
5476
copyLibs = true;
5577
};
5678
project = leanPkgs.buildLeanPackage {
5779
debug = false;
5880
deps = [ ipld.project.${system} ];
5981
name = "Yatima";
60-
src = ./src;
82+
src = ./.;
6183
};
6284
main = leanPkgs.buildLeanPackage {
6385
debug = false;

0 commit comments

Comments
 (0)