Skip to content

Commit

Permalink
Add a dev shell
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Oct 1, 2024
1 parent f8a7d13 commit cb9adf7
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,27 @@
rev = "v3.10.3";
sha256 = "EBzwaHyDWF8h/z3Zfq4p/n5Vpz7Ozlc3eoWDKXWv2YY=";
};

tools-environment = {
CHARON_HOME = inputs.charon.packages.${system}.default;
EURYDICE_HOME = pkgs.runCommand "eurydice-home" { } ''
mkdir -p $out
cp -r ${inputs.eurydice.packages.${system}.default}/bin/eurydice $out
cp -r ${inputs.eurydice}/include $out
'';
FSTAR_HOME = inputs.fstar.packages.${system}.default;
KRML_HOME = inputs.karamel.packages.${system}.default.home;

CHARON_REV = inputs.charon.rev;
EURYDICE_REV = inputs.eurydice.rev;
KRML_REV = inputs.karamel.rev;
FSTAR_REV = inputs.fstar.rev;
};

craneLib = inputs.crane.mkLib pkgs;
src = ./.;
cargoArtifacts = craneLib.buildDepsOnly { inherit src; };
ml-kem = craneLib.buildPackage {
ml-kem = craneLib.buildPackage (tools-environment // {
name = "ml-kem";
inherit src cargoArtifacts;

Expand Down Expand Up @@ -80,26 +97,22 @@
cd ./..
cp -r . $out
'';

CHARON_HOME = inputs.charon.packages.${system}.default;
EURYDICE_HOME = pkgs.runCommand "eurydice-home" { } ''
mkdir -p $out
cp -r ${inputs.eurydice.packages.${system}.default}/bin/eurydice $out
cp -r ${inputs.eurydice}/include $out
'';
FSTAR_HOME = inputs.fstar.packages.${system}.default;
KRML_HOME = inputs.karamel.packages.${system}.default.home;

CHARON_REV = inputs.charon.rev;
EURYDICE_REV = inputs.eurydice.rev;
KRML_REV = inputs.karamel.rev;
FSTAR_REV = inputs.fstar.rev;
};
});
in
{
rec {
packages = {
inherit ml-kem;
};
devShells.default = pkgs.mkShell (tools-environment // {
packages = [
pkgs.clang
inputs.fstar.packages.${system}.default
];

inputsFrom = [
packages.ml-kem
];
});
}
);
}

0 comments on commit cb9adf7

Please sign in to comment.