Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
run: nix develop -c graph build

- name: Run Matchstick tests
run: nix develop -c offchain-assets-subgraph-test
run: nix develop -c subgraph-test
61 changes: 13 additions & 48 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,21 @@
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {self, rainix, flake-utils, ... }:
outputs = { self, rainix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = rainix.pkgs.${system};
let pkgs = rainix.pkgs.${system};
in rec {
packages = rec{
the-graph = pkgs.stdenv.mkDerivation rec {
pname = "the-graph";
version = "0.69.2";
src = let
release-name = "%40graphprotocol%2Fgraph-cli%400.69.2";
system-mapping = {
x86_64-linux = "linux-x64";
x86_64-darwin = "darwin-x64";
aarch64-darwin = "darwin-arm64";
};
system-sha = {
x86_64-linux = "sha256:07grrdrx8w3m8sqwdmf9z9zymwnnzxckgnnjzfndk03a8r2d826m";
x86_64-darwin = "sha256:0j4p2bkx6pflkif6xkvfy4vj1v183mkg59p2kf3rk48wqfclids8";
aarch64-darwin = "sha256:0pq0g0fq1myp0s58lswhcab6ccszpi5sx6l3y9a18ai0c6yzxim0";
};
in
builtins.fetchTarball {
url = "https://github.com/graphprotocol/graph-tooling/releases/download/${release-name}/graph-${system-mapping.${system}}.tar.gz";
sha256 = system-sha.${system};
};
buildInputs = [];
installPhase = ''
mkdir -p $out
cp -r $src/* $out
'';
};
offchain-assets-subgraph-test = rainix.mkTask.${system} {
name = "offchain-assets-subgraph-test";
body = ''
set -euxo pipefail
docker compose up --abort-on-container-exit
'';
};
} // rainix.packages.${system};

devShells.default = pkgs.mkShell {
packages = [packages.offchain-assets-subgraph-test];

shellHook = rainix.devShells.${system}.default.shellHook;
buildInputs = rainix.devShells.${system}.default.buildInputs;
nativeBuildInputs = rainix.devShells.${system}.default.nativeBuildInputs;
subgraph-test = rainix.mkTask.${system} {
name = "subgraph-test";
body = ''
set -euxo pipefail
docker compose up --abort-on-container-exit
'';
};

}
);
devShells.default = rainix.devShells.${system}.default.overrideAttrs
(old: { buildInputs = [ subgraph-test ] ++ old.buildInputs; });

});

}
}
Loading