From 9305fbc2ff04b6c7e939e7747c13d031ef8f9fff Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 23 Jul 2023 17:05:15 +0300 Subject: [PATCH] feat(pkgs): add `circom` and `circom-lsp` --- pkgs/circom-lsp/default.nix | 33 +++++++++++++++++++++++++++++++++ pkgs/circom/default.nix | 33 +++++++++++++++++++++++++++++++++ pkgs/default.nix | 2 ++ 3 files changed, 68 insertions(+) create mode 100644 pkgs/circom-lsp/default.nix create mode 100644 pkgs/circom/default.nix diff --git a/pkgs/circom-lsp/default.nix b/pkgs/circom-lsp/default.nix new file mode 100644 index 0000000..5fa275d --- /dev/null +++ b/pkgs/circom-lsp/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchFromGitHub, rustPlatform, openssl, pkg-config, libxkbcommon }: + +rustPlatform.buildRustPackage rec { + pname = "circom-lsp"; + version = "0.1.3"; + + src = "${fetchFromGitHub { + owner = "rubydusa"; + repo = pname; + rev = "refs/tags/v${version}"; + sha256 = "sha256-Y71qmeDUh6MwSlFrSnG+Nr/un5szTUo27+J/HphGr7M="; + }}/server"; + + cargoSha256 = "sha256-Lq8SpzkUqYgayQTApNngOlhceAQAPG9Rwg1pmGvyxnM="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ ]; + + PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; + LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; + + doCheck = false; + + meta = with lib; { + description = "A Language Server Protocol Implementation for Circom"; + homepage = "https://github.com/rubydusa/circom-lsp"; + license = licenses.isc; + maintainers = with maintainers; [ reo101 ]; + }; +} diff --git a/pkgs/circom/default.nix b/pkgs/circom/default.nix new file mode 100644 index 0000000..3dcfbb3 --- /dev/null +++ b/pkgs/circom/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchFromGitHub, rustPlatform, openssl, pkg-config, libxkbcommon }: + +rustPlatform.buildRustPackage rec { + pname = "circom"; + version = "2.1.6"; + + src = fetchFromGitHub { + owner = "iden3"; + repo = pname; + rev = "refs/tags/v${version}"; + sha256 = "sha256-2YusBWAYDrTvFHYIjKpALphhmtsec7jjKHb1sc9lt3Q="; + }; + + cargoSha256 = "sha256-G6z+DxIhmm1Kzv8EQCqvfGAhQn5Vrx9LXrl+bWBVKaM="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ ]; + + PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; + LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; + + doCheck = false; + + meta = with lib; { + description = "zkSnark circuit compiler"; + homepage = "https://github.com/iden3/circom"; + license = licenses.isc; + maintainers = with maintainers; [ reo101 ]; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 77f0d85..460f6a8 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,6 +6,8 @@ }: { # example = pkgs.callPackage ./example { }; advcpmv = pkgs.callPackage ./advcpmv { }; + circom = pkgs.callPackage ./circom { }; + circom-lsp = pkgs.callPackage ./circom-lsp { }; fennel-language-server = pkgs.callPackage ./fennel-language-server { }; parinfer-rust = pkgs.callPackage ./parinfer-rust { }; pest-ide-tools = pkgs.callPackage ./pest-ide-tools { };