From d2c3275323c612e2a411c586e4ed690255b4c125 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 21 Apr 2024 18:44:39 -0700 Subject: [PATCH] get complement via flake inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Added input 'complement': 'github:matrix-org/complement/d73c81a091604b0fc5b6b0617dcac58c25763f57?narHash=sha256-hom/Lt0gZzLWqFhUJG0X2i88CAMIILInO5w0tPj6G3s%3D' (2024-04-18) --- flake.lock | 17 +++++++++++++++++ flake.nix | 10 ++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index bb767e47..98ef9259 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,22 @@ "type": "github" } }, + "complement": { + "flake": false, + "locked": { + "lastModified": 1713458251, + "narHash": "sha256-hom/Lt0gZzLWqFhUJG0X2i88CAMIILInO5w0tPj6G3s=", + "owner": "matrix-org", + "repo": "complement", + "rev": "d73c81a091604b0fc5b6b0617dcac58c25763f57", + "type": "github" + }, + "original": { + "owner": "matrix-org", + "repo": "complement", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": [ @@ -234,6 +250,7 @@ "root": { "inputs": { "attic": "attic", + "complement": "complement", "crane": "crane_2", "fenix": "fenix", "flake-compat": "flake-compat_2", diff --git a/flake.nix b/flake.nix index a9ca5cee..67143ccd 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { attic.url = "github:zhaofengli/attic?ref=main"; + complement = { url = "github:matrix-org/complement"; flake = false; }; crane = { url = "github:ipetkov/crane?ref=master"; inputs.nixpkgs.follows = "nixpkgs"; }; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; @@ -197,19 +198,12 @@ }; createComplementRuntime = pkgs: image: let - complement = pkgs.fetchFromGitHub { - owner = "matrix-org"; - repo = "complement"; - rev = "d73c81a091604b0fc5b6b0617dcac58c25763f57"; - hash = "sha256-hom/Lt0gZzLWqFhUJG0X2i88CAMIILInO5w0tPj6G3s"; - }; - script = pkgs.writeShellScriptBin "run.sh" '' export PATH=${pkgs.lib.makeBinPath [ pkgs.olm pkgs.gcc ]} ${pkgs.lib.getExe pkgs.docker} load < ${image} set +o pipefail - /usr/bin/env -C "${complement}" COMPLEMENT_BASE_IMAGE="complement-conduit:dev" ${pkgs.lib.getExe pkgs.go} test -json ${complement}/tests | ${pkgs.toybox}/bin/tee $1 + /usr/bin/env -C "${inputs.complement}" COMPLEMENT_BASE_IMAGE="complement-conduit:dev" ${pkgs.lib.getExe pkgs.go} test -json ${inputs.complement}/tests | ${pkgs.toybox}/bin/tee $1 set -o pipefail # Post-process the results into an easy-to-compare format