nix: added flake and derivation for the project
Signed-off-by: markoburcul <marko@status.im>
This commit is contained in:
parent
ddf956e310
commit
f1f7baf3d2
|
@ -5,7 +5,11 @@ target/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
Cargo.lock
|
# Commented since for nix derivation we need the Cargo.lock file.
|
||||||
|
# Cargo.lock
|
||||||
|
|
||||||
|
# If built with Nix, the target with be within result directory.
|
||||||
|
result
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -18,7 +18,7 @@ crate-type = [
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
ark-circom = { git = "https://github.com/codex-storage/circom-compat.git#71f1ceb11aef27256", features = ["circom-2", "ethereum"]}
|
ark-circom = { git = "https://github.com/codex-storage/circom-compat.git", rev = "71f1ceb11aef27256", features = ["circom-2", "ethereum"]}
|
||||||
|
|
||||||
ark-crypto-primitives = { version = "=0.4.0" }
|
ark-crypto-primitives = { version = "=0.4.0" }
|
||||||
ark-ec = { version = "=0.4.1", default-features = false, features = ["parallel"] }
|
ark-ec = { version = "=0.4.1", default-features = false, features = ["parallel"] }
|
||||||
|
|
|
@ -1,2 +1,8 @@
|
||||||
# circom-compat-ffi
|
# circom-compat-ffi
|
||||||
circom-compat (ark-circom) ffi
|
circom-compat (ark-circom) ffi
|
||||||
|
|
||||||
|
|
||||||
|
# Build with Nix
|
||||||
|
```nix
|
||||||
|
nix build
|
||||||
|
```
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
pkgs.rustPlatform.buildRustPackage {
|
||||||
|
pname = "circom-compat-ffi";
|
||||||
|
version = "0.1.0";
|
||||||
|
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = ./Cargo.lock;
|
||||||
|
allowBuiltinFetchGit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
CARGO_HOME = "/tmp";
|
||||||
|
cargoBuildFlags = ["--release"];
|
||||||
|
|
||||||
|
meta = with pkgs.lib; {
|
||||||
|
description = "circom-compat (ark-circom) ffi";
|
||||||
|
license = licenses.mit;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731386116,
|
||||||
|
"narHash": "sha256-lKA770aUmjPHdTaJWnP3yQ9OI1TigenUqVC3wweqZuI=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "689fed12a013f56d4c4d3f612489634267d86529",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-24.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
description = "A flake for building circom-compat (ark-circom) ffi";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }:
|
||||||
|
let
|
||||||
|
stableSystems = [
|
||||||
|
"x86_64-linux" "aarch64-linux"
|
||||||
|
"x86_64-darwin" "aarch64-darwin"
|
||||||
|
];
|
||||||
|
forAllSystems = nixpkgs.lib.genAttrs stableSystems;
|
||||||
|
pkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = forAllSystems (system: let
|
||||||
|
pkgs = pkgsFor.${system};
|
||||||
|
in {
|
||||||
|
default = pkgs.callPackage ./default.nix {};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue