Skip to content

Commit

Permalink
feat(nix): Nixify Noir
Browse files Browse the repository at this point in the history
  • Loading branch information
SersemPeca committed Jan 6, 2025
1 parent 5bef5b6 commit dd54495
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;};
};
};
}
46 changes: 46 additions & 0 deletions nix/noir.nix
Original file line number Diff line number Diff line change
@@ -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 = "";
}
2 changes: 1 addition & 1 deletion shell.nix → nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions derivation.nix → nix/venir.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
File renamed without changes.

0 comments on commit dd54495

Please sign in to comment.