attempted to fix the herc part of the flake

This commit is contained in:
Quinn Dougherty 2022-08-16 22:24:32 -07:00
parent 84f0cfd3b0
commit 94d57491bd
2 changed files with 31 additions and 14 deletions

View File

@ -34,24 +34,30 @@
system = "wasm32-wasi"; system = "wasm32-wasi";
useLLVM = true; useLLVM = true;
}; };
overlays = [ overlays = [
cargo2nix.overlays.default cargo2nix.overlays.default
(final: prev: { (final: prev: {
# set the node version here # set the node version here
nodejs = prev.nodejs-18_x; nodejs = prev.nodejs-18_x;
# The override is the only way to get it into mkYarnModules # The override is the only way to get it into mkYarnModules
}) })
]; ];
commonFn = pkgs: { commonFn = pkgs: {
buildInputs = with pkgs; [ nodejs yarn ]; buildInputs = with pkgs; [ nodejs yarn ];
prettier = with pkgs.nodePackages; [ prettier ]; prettier = with pkgs.nodePackages; [ prettier ];
which = [ pkgs.which ]; which = [ pkgs.which ];
}; };
naerskFn = { pkgs, rust, ... }: pkgs.callPackage naersk { cargo = rust; rustc = rust; }; naerskFn = { pkgs, rust, ... }:
pkgs.callPackage naersk {
cargo = rust;
rustc = rust;
};
gentypeOutputFn = pkgs: gentype.outputs.packages.${pkgs.system}.default; gentypeOutputFn = pkgs: gentype.outputs.packages.${pkgs.system}.default;
mcFn = { pkgs, wasmPkgs, ... }: mcFn = { pkgs, wasmPkgs, ... }:
import ./nix/squiggle-mc.nix { inherit pkgs wasmPkgs commonFn naerskFn; }; import ./nix/squiggle-mc.nix {
inherit pkgs wasmPkgs commonFn naerskFn;
};
langFn = { pkgs, ... }: langFn = { pkgs, ... }:
import ./nix/squiggle-lang.nix { import ./nix/squiggle-lang.nix {
inherit pkgs commonFn mcFn gentypeOutputFn; inherit pkgs commonFn mcFn gentypeOutputFn;
@ -105,9 +111,16 @@
herc = let herc = let
hciSystem = "x86_64-linux"; hciSystem = "x86_64-linux";
hciPkgs = import nixpkgs { system = hciSystem; }; hciPkgs = import nixpkgs { system = hciSystem; };
hciPkgsWasm = import nixpkgs { system = hciSystem; crossSystem = crossSystemForWasmPkgs; overlays = overlays; }; hciPkgsWasm = import nixpkgs {
system = hciSystem;
crossSystem = crossSystemForWasmPkgs;
overlays = overlays;
};
effects = hercules-ci-effects.lib.withPkgs hciPkgs; effects = hercules-ci-effects.lib.withPkgs hciPkgs;
mc = mcFn hciPkgs hciPkgsWasm; mc = mcFn {
pkgs = hciPkgs;
wasmPkgs = hciPkgsWasm;
};
lang = langFn hciPkgs; lang = langFn hciPkgs;
components = componentsFn hciPkgs; components = componentsFn hciPkgs;
website = websiteFn hciPkgs; website = websiteFn hciPkgs;
@ -151,5 +164,8 @@
crossSystem = crossSystemForWasmPkgs; crossSystem = crossSystemForWasmPkgs;
}; };
in localFlake { pkgs = pkgs; wasmPkgs = pkgsWasm; }) // herc; in localFlake {
pkgs = pkgs;
wasmPkgs = pkgsWasm;
}) // herc;
} }

View File

@ -57,7 +57,8 @@ rec {
firefox-test = pkgs.stdenv.mkDerivation { firefox-test = pkgs.stdenv.mkDerivation {
name = "squiggle-mc-test"; name = "squiggle-mc-test";
src = yarn-source + "/libexec/@quri/squiggle-mc/deps/@quri/squiggle-mc"; src = yarn-source + "/libexec/@quri/squiggle-mc/deps/@quri/squiggle-mc";
buildInputs = common.buildInputs ++ (with pkgs; [ geckodriver cargo wasm-pack ]); buildInputs = common.buildInputs
++ (with pkgs; [ geckodriver cargo wasm-pack ]);
buildPhase = "yarn --offline test -- --firefox"; buildPhase = "yarn --offline test -- --firefox";
installPhase = "mkdir -p $out"; installPhase = "mkdir -p $out";
}; };