From e49c77df1d27862f76017a956cd850eb1c93c5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijan=20Petri=C4=8Devi=C4=87?= Date: Fri, 23 Feb 2024 19:02:32 +0700 Subject: [PATCH] flake: add kairos-deposit-contract wasm32 build-output --- flake.lock | 12 ++++++------ flake.nix | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 86ebe934..fde16f07 100644 --- a/flake.lock +++ b/flake.lock @@ -44,11 +44,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1704781388, - "narHash": "sha256-QEmlnHkDkbDud5M+eXPvJpETXMaodtdM3fs635wzgfA=", + "lastModified": 1708410168, + "narHash": "sha256-98kCv2PbKfqt+oyyXHqdXPRRGjW+QEy9eBzNtRyCRHs=", "owner": "nix-community", "repo": "fenix", - "rev": "50818d34497c48efbf21b965cf247bda90ffc7e0", + "rev": "846fc5ddb810c36411de6587384bef86c2db5127", "type": "github" }, "original": { @@ -143,11 +143,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1704734508, - "narHash": "sha256-avMO21rwRepZXP3yJEgQDuFTatreWwyI6pau1jzuMtA=", + "lastModified": 1708361159, + "narHash": "sha256-HAZ/pEN0TVFoGMbITliYXbMLPaSy/X+WKY/y6K8iTr0=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "12e7aa3132217cc6a6c1151d468be35d7b365999", + "rev": "2223b4fa71e543ac6dd1abd4770a69fab8dbdec1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 59d93946..c4eb5eab 100644 --- a/flake.nix +++ b/flake.nix @@ -39,9 +39,21 @@ ]; perSystem = { config, self', inputs', system, pkgs, lib, ... }: let - rustToolchain = inputs'.fenix.packages.stable.toolchain; + rustToolchain = with inputs'.fenix.packages; combine [ + complete.toolchain + targets.wasm32-unknown-unknown.latest.rust-std + ]; craneLib = inputs.crane.lib.${system}.overrideToolchain rustToolchain; + kairosOnChainAttrs = { + src = lib.cleanSourceWith { + src = craneLib.path ./kairos-deposit-contract; + filter = path: type: craneLib.filterCargoSources path type; + }; + cargoExtraArgs = "--target wasm32-unknown-unknown"; + doCheck = false; + }; + kairosNodeAttrs = { src = lib.cleanSourceWith { src = craneLib.path ./.; @@ -73,6 +85,14 @@ cargoArtifacts = self'.packages.kairos-deps; }); + kairos-deposit-contract-deps = craneLib.buildPackage (kairosOnChainAttrs // { + pname = "kairos-deposit-contract"; + }); + + kairos-deposit-contract = craneLib.buildPackage (kairosOnChainAttrs // { + cargoArtifacts = self'.packages.kairos-deposit-contract-deps; + }); + default = self'.packages.kairos; kairos-docs = craneLib.cargoDoc (kairosNodeAttrs // {