Unverified Commit a18fc3d2 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

nym: refactor (#346128)

parents 3b18ac6c 46fe03f6
Loading
Loading
Loading
Loading
+4845 −2201

File changed and moved.

Preview size limit exceeded, changes collapsed.

+79 −0
Original line number Diff line number Diff line
{ stdenv
, lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, openssl
, Security
, CoreServices
, nix-update-script
, rustc
{
  stdenv,
  lib,
  rustPlatform,
  fetchFromGitHub,
  pkg-config,
  openssl,
  darwin,
  nix-update-script,
  rustc,
}:

let
  version = "1.1.21";
  hash = "sha256-VM0Pc5qyrsn9wV3mfvrAlCfm/rIf3cednZzFtJCT+no=";
in
rustPlatform.buildRustPackage {
rustPlatform.buildRustPackage rec {
  pname = "nym";
  inherit version;
  version = "2024.10-caramello";

  src = fetchFromGitHub {
    owner = "nymtech";
    repo = "nym";
    rev = "nym-binaries-v${version}";
    inherit hash;
    hash = "sha256-0vEvjVCbwyJ7lpvZnIT551Kul0JfkcNSeURbX2PUZ4w=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "bls12_381-0.6.0" = "sha256-sIZy+CTASP+uiY10nP/N4WfCLjeqkjiNl/FzO0p5WdI=";
      "cosmos-sdk-proto-0.12.3" = "sha256-ekQ9JA6WaTkvHkBKJbYPzfmx6I7LZnhIPiHsZFAP90w=";
      "rocket_cors-0.5.2" = "sha256-hfk5gKtc94g+VZmm+S6HKvg+E71QVKQTK2E3K2MCvz0=";
      "wasm-timer-0.2.5" = "sha256-od+r3ttFpFhcIh8rPQJQARaQLsbLeEZpCY1h9c4gow8=";
      "bls12_381-0.8.0" = "sha256-4+X/ZQ5Z+Nax4Ot1JWWvvLxuIUaucHkfnDB2L+Ak7Ro=";
      "cosmos-sdk-proto-0.22.0-pre" = "sha256-nRfcAbjFcvAqool+6heYK8joiU5YaSWITnO6S5MRM1E=";
      "indexed_db_futures-0.4.2" = "sha256-vVqrD40CBdSSEtU+kQeuZUfsgpJdl8ks+os0Fct8Ung=";
    };
  };

  postPatch = ''
    substituteInPlace contracts/vesting/build.rs \
      --replace 'vergen(config).expect("failed to extract build metadata")' '()'

    substituteInPlace common/bin-common/build.rs \
      --replace 'vergen(config).expect("failed to extract build metadata")' '()'
  '';

  nativeBuildInputs = [ pkg-config ];
  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security CoreServices ];
  buildInputs =
    [
      openssl
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin (
      with darwin.apple_sdk.frameworks;
      [
        Security
        SystemConfiguration
        CoreServices
      ]
    );

  checkType = "debug";

  passthru.updateScript = nix-update-script { };

  checkFlags = [
    "--skip=commands::upgrade::upgrade_tests"
    "--skip=allowed_hosts::filter::tests::creating_a_new_host_store"
    "--skip=allowed_hosts::filter::tests::getting_the_domain_root"
    "--skip=allowed_hosts::filter::tests::requests_to_allowed_hosts"
    "--skip=allowed_hosts::filter::tests::requests_to_unknown_hosts"
    "--skip=ping::http::tests::resolve_host_with_valid_hostname_returns_some"
  ];

  env = {
    VERGEN_BUILD_TIMESTAMP = "0";
    VERGEN_BUILD_SEMVER = version;
    VERGEN_GIT_SHA = hash;
    VERGEN_GIT_COMMIT_TIMESTAMP = "0";
    VERGEN_GIT_BRANCH = "master";
    VERGEN_RUSTC_SEMVER = rustc.version;
@@ -71,14 +61,19 @@ rustPlatform.buildRustPackage {
    VERGEN_CARGO_PROFILE = "release";
  };

  meta = with lib; {
  checkFlags = [
    "--skip=ping::http::tests::resolve_host_with_valid_hostname_returns_some"
  ];

  meta = {
    description = "Mixnet providing IP-level privacy";
    longDescription = ''
      Nym routes IP packets through other participating nodes to hide their source and destination.
      In contrast with Tor, it prevents timing attacks at the cost of latency.
    '';
    homepage = "https://nymtech.net";
    license = licenses.asl20;
    platforms = platforms.all;
    license = lib.licenses.asl20;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ bot-wxt1221 ];
  };
}
+0 −4
Original line number Diff line number Diff line
@@ -10609,10 +10609,6 @@ with pkgs;
  nylon = callPackage ../tools/networking/nylon { };
  nym = darwin.apple_sdk_11_0.callPackage ../applications/networking/nym {
    inherit (darwin.apple_sdk.frameworks) Security CoreServices;
  };
  oapi-codegen = callPackage ../tools/networking/oapi-codegen { };
  oatpp = callPackage ../development/libraries/oatpp { };