diff --git a/flake.nix b/flake.nix index 4e54bedb634..b677f8c3b6c 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,10 @@ rustc rustfmt ]; - devShells.default = import ./shell.nix {inherit pkgs self' venir-toolchain verus-lib;}; + + devShells.default = import ./nix/shell.nix {inherit pkgs self' venir-toolchain verus-lib;}; + + packages.default = import ./nix/noir.nix {inherit pkgs self' venir-toolchain verus-lib;}; }; }; } diff --git a/nix/noir.nix b/nix/noir.nix new file mode 100644 index 00000000000..f9a2a5be052 --- /dev/null +++ b/nix/noir.nix @@ -0,0 +1,46 @@ +{ + pkgs, + self', + venir-toolchain, + ... +}: let + inherit (pkgs) lib rustPlatform fetchFromGitHub; + + customRustPlatform = pkgs.makeRustPlatform { + cargo = venir-toolchain; + rustc = venir-toolchain; + }; +in + customRustPlatform.buildRustPackage rec { + pname = "Noir"; + name = pname; + binaryName = "nargo"; + version = "0.1.0"; + + RUSTC_BOOTSTRAP = 1; + + GIT_COMMIT = "disable"; + GIT_DIRTY = "disable"; + # RUST_BACKTRACE = 1; + + doCheck = false; + + src = ../.; + + cargoLock = { + lockFile = "${src}/Cargo.lock"; + + outputHashes = { + "air-0.1.0" = "sha256-DziMs2hjVZJ/5lsoRAVcmbPwEbW7heyad6qq/Se+QVE="; + "chumsky-0.8.0" = "sha256-TvITrQMJlaBWx2tayYMX8AcvV4i0fyxrveBSMVojPMk="; + "clap-markdown-0.1.3" = "sha256-2vG7x+7T7FrymDvbsR35l4pVzgixxq9paXYNeKenrkQ="; + "getopts-0.2.21" = "sha256-r9CiPUSsjhThK6RG3AvhfTjaXMex/VV7CbdLQIDMdTk="; + "plonky2-0.2.0" = "sha256-2oheUUDu4ggNZEX9sF3Ef3PNrdFIUg5POeOFIEXEkUY="; + "plonky2_u32-0.1.0" = "sha256-COTm1Fi90+vCnc1MnqyKh8/DVzo/B9VO2o0RQvE9/nM="; + "runtime_tracing-0.5.12" = "sha256-RcKL8tmdnLaGnMjreBr1zi3MOW/WXdMOS6bU8qPjmVQ="; + "smt2parser-0.6.1" = "sha256-AKBq8Ph8D2ucyaBpmDtOypwYie12xVl4gLRxttv5Ods="; + }; + }; + + cargoHash = ""; + } diff --git a/shell.nix b/nix/shell.nix similarity index 90% rename from shell.nix rename to nix/shell.nix index 12dc1d8e53c..eee40985a37 100644 --- a/shell.nix +++ b/nix/shell.nix @@ -8,7 +8,7 @@ }: let inherit (pkgs) lib stdenv mkShell; inherit (pkgs.darwin.apple_sdk) frameworks; - venir = import ./derivation.nix {inherit pkgs self' venir-toolchain;}; + venir = import ./venir.nix {inherit pkgs self' venir-toolchain;}; verus-std = import ./verusStd.nix {inherit pkgs self' venir-toolchain verus-lib;}; in mkShell { diff --git a/derivation.nix b/nix/venir.nix similarity index 96% rename from derivation.nix rename to nix/venir.nix index cacfc01be1b..9cb25da1907 100644 --- a/derivation.nix +++ b/nix/venir.nix @@ -19,8 +19,10 @@ in version = "0.1.0"; RUSTC_BOOTSTRAP = 1; + RUST_BACKTRACE = 1; doCheck = false; + GIT_COMMIT = "disable"; src = fetchFromGitHub { owner = "blocksense-network"; diff --git a/verusStd.nix b/nix/verusStd.nix similarity index 100% rename from verusStd.nix rename to nix/verusStd.nix