Skip to content

Commit

Permalink
Merge pull request #136 from Nadrieril/fix-flake
Browse files Browse the repository at this point in the history
Fix the nix flake
  • Loading branch information
franziskuskiefer authored Jan 24, 2025
2 parents 5791583 + 855634d commit 56313b8
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@
};
hax.url = "github:hacspec/hax";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
hax = inputs.hax.packages.${system}.default;
pkgs = import inputs.nixpkgs { inherit system; };
craneLib = inputs.crane.mkLib pkgs;
src = ./.;
cargoArtifacts = craneLib.buildDepsOnly { inherit src; };
bertie = craneLib.buildPackage {
outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import inputs.nixpkgs { inherit system; };
# Make an overrideable package.
bertie = { python3, craneLib, hax, runCommand, cargoLock }:
let
src = runCommand "bertie-src" { } ''
cp -r ${./.} $out
chmod u+w $out
rm -f $out/Cargo.lock
cp ${cargoLock} $out/Cargo.lock
'';
cargoArtifacts = craneLib.buildDepsOnly { inherit src; };
in
craneLib.buildPackage {
inherit src cargoArtifacts;
buildInputs = [
hax
pkgs.python3
python3
];
buildPhase = ''
python hax-driver.py extract-fstar
Expand All @@ -31,9 +35,13 @@
installPhase = "cp -r . $out";
doCheck = false;
};
in
{
packages.default = bertie;
}
);
hax = inputs.hax.packages.${system}.default;
craneLib = inputs.crane.mkLib pkgs;
in
{
# Takes the lockfile as input.
packages.default = cargoLock: pkgs.callPackage bertie { inherit hax craneLib cargoLock; };
devShells.default = craneLib.devShell { };
}
);
}

0 comments on commit 56313b8

Please sign in to comment.