Skip to content
Snippets Groups Projects
libchallenge-bypass-ristretto-ffi.nix 47 KiB
Newer Older
Jean-Paul Calderone's avatar
Jean-Paul Calderone committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000

# This file was @generated by crate2nix 0.10.0 with the command:
#   "generate" "--cargo-toml" "/home/exarkun/Work/PrivateStorage/challenge-bypass-ristretto-ffi/Cargo.toml"
# See https://github.com/kolloch/crate2nix for more info.

{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs { config = {}; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, buildRustCrateForPkgs ? if buildRustCrate != null
    then lib.warn "crate2nix: Passing `buildRustCrate` as argument to Cargo.nix is deprecated. If you don't customize `buildRustCrate`, replace `callPackage ./Cargo.nix {}` by `import ./Cargo.nix { inherit pkgs; }`, and if you need to customize `buildRustCrate`, use `buildRustCrateForPkgs` instead." (_: buildRustCrate)
    else pkgs: pkgs.buildRustCrate
  # Deprecated
, buildRustCrate ? null
  # This is used as the `crateOverrides` argument for `buildRustCrate`.
, defaultCrateOverrides ? pkgs.defaultCrateOverrides
  # The features to enable for the root_crate or the workspace_members.
, rootFeatures ? [ "default" ]
  # If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false
  # Used for conditional compilation based on CPU feature detection.
, targetFeatures ? []
  # Whether to perform release builds: longer compile times, faster binaries.
, release ? true
  # Additional crate2nix configuration if it exists.
, crateConfig
  ? if builtins.pathExists ./crate-config.nix
    then pkgs.callPackage ./crate-config.nix {}
    else {}
}:

rec {
  #
  # "public" attributes that we attempt to keep stable with new versions of crate2nix.
  #

  rootCrate = rec {
    packageId = "challenge-bypass-ristretto-ffi";

    # Use this attribute to refer to the derivation building your root crate package.
    # You can override the features with rootCrate.build.override { features = [ "default" "feature1" ... ]; }.
    build = internal.buildRustCrateWithFeatures {
      inherit packageId;
    };

    # Debug support which might change between releases.
    # File a bug if you depend on any for non-debug work!
    debug = internal.debugCrate { inherit packageId; };
  };
  # Refer your crate build derivation by name here.
  # You can override the features with
  # workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }.
  workspaceMembers = {
    "challenge-bypass-ristretto-ffi" = rec {
      packageId = "challenge-bypass-ristretto-ffi";
      build = internal.buildRustCrateWithFeatures {
        packageId = "challenge-bypass-ristretto-ffi";
      };

      # Debug support which might change between releases.
      # File a bug if you depend on any for non-debug work!
      debug = internal.debugCrate { inherit packageId; };
    };
  };

  # A derivation that joins the outputs of all workspace members together.
  allWorkspaceMembers = pkgs.symlinkJoin {
      name = "all-workspace-members";
      paths =
        let members = builtins.attrValues workspaceMembers;
        in builtins.map (m: m.build) members;
  };

  #
  # "internal" ("private") attributes that may change in every new version of crate2nix.
  #

  internal = rec {
    # Build and dependency information for crates.
    # Many of the fields are passed one-to-one to buildRustCrate.
    #
    # Noteworthy:
    # * `dependencies`/`buildDependencies`: similar to the corresponding fields for buildRustCrate.
    #   but with additional information which is used during dependency/feature resolution.
    # * `resolvedDependencies`: the selected default features reported by cargo - only included for debugging.
    # * `devDependencies` as of now not used by `buildRustCrate` but used to
    #   inject test dependencies into the build

    crates = {
      "base64 0.13.0" = rec {
        crateName = "base64";
        version = "0.13.0";
        edition = "2018";
        sha256 = "1z82g23mbzjgijkpcrilc7nljpxpvpf7zxf6iyiapkgka2ngwkch";
        authors = [
          "Alice Maz <alice@alicemaz.com>"
          "Marshall Pierce <marshall@mpierce.org>"
        ];
        features = {
          "default" = [ "std" ];
        };
        resolvedDefaultFeatures = [ "default" "std" ];
      };
      "base64 0.9.3" = rec {
        crateName = "base64";
        version = "0.9.3";
        edition = "2015";
        sha256 = "0hs62r35bgxslawyrn1vp9rmvrkkm76fqv0vqcwd048vs876r7a8";
        authors = [
          "Alice Maz <alice@alicemaz.com>"
          "Marshall Pierce <marshall@mpierce.org>"
        ];
        dependencies = [
          {
            name = "byteorder";
            packageId = "byteorder";
          }
          {
            name = "safemem";
            packageId = "safemem";
          }
        ];

      };
      "block-buffer" = rec {
        crateName = "block-buffer";
        version = "0.9.0";
        edition = "2018";
        sha256 = "1r4pf90s7d7lj1wdjhlnqa26vvbm6pnc33z138lxpnp9srpi2lj1";
        authors = [
          "RustCrypto Developers"
        ];
        dependencies = [
          {
            name = "generic-array";
            packageId = "generic-array";
          }
        ];
        features = {
          "block-padding" = [ "dep:block-padding" ];
        };
      };
      "byteorder" = rec {
        crateName = "byteorder";
        version = "1.4.3";
        edition = "2018";
        sha256 = "0456lv9xi1a5bcm32arknf33ikv76p3fr9yzki4lb2897p2qkh8l";
        authors = [
          "Andrew Gallant <jamslam@gmail.com>"
        ];
        features = {
          "default" = [ "std" ];
        };
        resolvedDefaultFeatures = [ "default" "i128" "std" ];
      };
      "cfg-if" = rec {
        crateName = "cfg-if";
        version = "1.0.0";
        edition = "2018";
        sha256 = "1za0vb97n4brpzpv8lsbnzmq5r8f2b0cpqqr0sy8h5bn751xxwds";
        authors = [
          "Alex Crichton <alex@alexcrichton.com>"
        ];
        features = {
          "compiler_builtins" = [ "dep:compiler_builtins" ];
          "core" = [ "dep:core" ];
          "rustc-dep-of-std" = [ "core" "compiler_builtins" ];
        };
      };
      "challenge-bypass-ristretto" = rec {
        crateName = "challenge-bypass-ristretto";
        version = "1.0.1";
        edition = "2018";
        sha256 = "146g14mnli3qibyqgw41cc4yhi0gwlspxm5m090knsg2kx9qnr8j";
        authors = [
          "eV <ev@7pr.xyz>"
        ];
        dependencies = [
          {
            name = "base64";
            packageId = "base64 0.13.0";
            optional = true;
          }
          {
            name = "crypto-mac";
            packageId = "crypto-mac";
          }
          {
            name = "curve25519-dalek";
            packageId = "curve25519-dalek";
            usesDefaultFeatures = false;
          }
          {
            name = "digest";
            packageId = "digest";
          }
          {
            name = "hmac";
            packageId = "hmac";
          }
          {
            name = "rand";
            packageId = "rand";
            usesDefaultFeatures = false;
          }
          {
            name = "rand_chacha";
            packageId = "rand_chacha";
          }
          {
            name = "rand_core";
            packageId = "rand_core";
          }
          {
            name = "subtle";
            packageId = "subtle";
            usesDefaultFeatures = false;
          }
          {
            name = "zeroize";
            packageId = "zeroize";
          }
        ];
        devDependencies = [
          {
            name = "base64";
            packageId = "base64 0.13.0";
          }
          {
            name = "rand";
            packageId = "rand";
          }
        ];
        features = {
          "alloc" = [ "curve25519-dalek/alloc" ];
          "avx2_backend" = [ "curve25519-dalek/avx2_backend" ];
          "base64" = [ "dep:base64" ];
          "default" = [ "std" "u64_backend" ];
          "merlin" = [ "dep:merlin" ];
          "nightly" = [ "curve25519-dalek/nightly" ];
          "serde" = [ "dep:serde" ];
          "serde_base64" = [ "serde" "base64" ];
          "std" = [ "alloc" "curve25519-dalek/std" "subtle/std" ];
          "u32_backend" = [ "curve25519-dalek/u32_backend" ];
          "u64_backend" = [ "curve25519-dalek/u64_backend" ];
        };
        resolvedDefaultFeatures = [ "alloc" "base64" "default" "nightly" "std" "u64_backend" ];
      };
      "challenge-bypass-ristretto-ffi" = rec {
        crateName = "challenge-bypass-ristretto-ffi";
        version = "1.0.1";
        edition = "2015";
        src = lib.cleanSourceWith { filter = sourceFilter;  src = /home/exarkun/Work/PrivateStorage/challenge-bypass-ristretto-ffi; };type = [ "cdylib" "staticlib" "rlib" ];
        authors = [
          "eV <ev@7pr.xyz>"
        ];
        dependencies = [
          {
            name = "base64";
            packageId = "base64 0.9.3";
          }
          {
            name = "challenge-bypass-ristretto";
            packageId = "challenge-bypass-ristretto";
            features = [ "base64" ];
          }
          {
            name = "hmac";
            packageId = "hmac";
          }
          {
            name = "rand";
            packageId = "rand";
          }
          {
            name = "sha2";
            packageId = "sha2";
          }
        ];
        features = {
          "nightly" = [ "challenge-bypass-ristretto/nightly" ];
        };
        resolvedDefaultFeatures = [ "cbindgen" "nightly" ];
      };
      "cpufeatures" = rec {
        crateName = "cpufeatures";
        version = "0.2.2";
        edition = "2018";
        sha256 = "0jsyrw41g5sqdpc9jgk57969hc0xw4c52j9amvmll4mbcwb019jr";
        authors = [
          "RustCrypto Developers"
        ];
        dependencies = [
          {
            name = "libc";
            packageId = "libc";
            target = { target, features }: (stdenv.hostPlatform.config == "aarch64-apple-darwin");
          }
          {
            name = "libc";
            packageId = "libc";
            target = { target, features }: (stdenv.hostPlatform.config == "aarch64-linux-android");
          }
          {
            name = "libc";
            packageId = "libc";
            target = { target, features }: ((target."arch" == "aarch64") && (target."os" == "linux"));
          }
        ];

      };
      "crypto-mac" = rec {
        crateName = "crypto-mac";
        version = "0.10.1";
        edition = "2018";
        sha256 = "06h84hcaksgjzzzc9g9dpmifwx221qzzif6fw8l807khxh471w5z";
        authors = [
          "RustCrypto Developers"
        ];
        dependencies = [
          {
            name = "generic-array";
            packageId = "generic-array";
          }
          {
            name = "subtle";
            packageId = "subtle";
            usesDefaultFeatures = false;
          }
        ];
        features = {
          "blobby" = [ "dep:blobby" ];
          "cipher" = [ "dep:cipher" ];
          "dev" = [ "blobby" ];
        };
      };
      "curve25519-dalek" = rec {
        crateName = "curve25519-dalek";
        version = "3.2.1";
        edition = "2015";
        sha256 = "1h0vcl8p4syvci9zxkn3h80h06xv1fyqgcrfwrv0lnbzjr9d1ych";
        authors = [
          "Isis Lovecruft <isis@patternsinthevoid.net>"
          "Henry de Valence <hdevalence@hdevalence.ca>"
        ];
        dependencies = [
          {
            name = "byteorder";
            packageId = "byteorder";
            usesDefaultFeatures = false;
            features = [ "i128" ];
          }
          {
            name = "digest";
            packageId = "digest";
            usesDefaultFeatures = false;
          }
          {
            name = "rand_core";
            packageId = "rand_core";
            usesDefaultFeatures = false;
          }
          {
            name = "subtle";
            packageId = "subtle";
            usesDefaultFeatures = false;
          }
          {
            name = "zeroize";
            packageId = "zeroize";
            usesDefaultFeatures = false;
          }
        ];
        features = {
          "alloc" = [ "zeroize/alloc" ];
          "avx2_backend" = [ "simd_backend" ];
          "default" = [ "std" "u64_backend" ];
          "fiat-crypto" = [ "dep:fiat-crypto" ];
          "fiat_u32_backend" = [ "fiat-crypto" ];
          "fiat_u64_backend" = [ "fiat-crypto" ];
          "nightly" = [ "subtle/nightly" ];
          "packed_simd" = [ "dep:packed_simd" ];
          "serde" = [ "dep:serde" ];
          "simd_backend" = [ "nightly" "u64_backend" "packed_simd" ];
          "std" = [ "alloc" "subtle/std" "rand_core/std" ];
        };
        resolvedDefaultFeatures = [ "alloc" "nightly" "std" "u64_backend" ];
      };
      "digest" = rec {
        crateName = "digest";
        version = "0.9.0";
        edition = "2018";
        sha256 = "0rmhvk33rgvd6ll71z8sng91a52rw14p0drjn1da0mqa138n1pfk";
        authors = [
          "RustCrypto Developers"
        ];
        dependencies = [
          {
            name = "generic-array";
            packageId = "generic-array";
          }
        ];
        features = {
          "blobby" = [ "dep:blobby" ];
          "dev" = [ "blobby" ];
          "std" = [ "alloc" ];
        };
        resolvedDefaultFeatures = [ "alloc" "std" ];
      };
      "generic-array" = rec {
        crateName = "generic-array";
        version = "0.14.5";
        edition = "2015";
        sha256 = "00qqhls43bzvyb7s26iw6knvsz3mckbxl3rhaahvypzhqwzd6j7x";
        libName = "generic_array";
        authors = [
          "Bartłomiej Kamiński <fizyk20@gmail.com>"
          "Aaron Trent <novacrazy@gmail.com>"
        ];
        dependencies = [
          {
            name = "typenum";
            packageId = "typenum";
          }
        ];
        buildDependencies = [
          {
            name = "version_check";
            packageId = "version_check";
          }
        ];
        features = {
          "serde" = [ "dep:serde" ];
        };
      };
      "getrandom" = rec {
        crateName = "getrandom";
        version = "0.1.16";
        edition = "2018";
        sha256 = "1kjzmz60qx9mn615ks1akjbf36n3lkv27zfwbcam0fzmj56wphwg";
        authors = [
          "The Rand Project Developers"
        ];
        dependencies = [
          {
            name = "cfg-if";
            packageId = "cfg-if";
          }
          {
            name = "libc";
            packageId = "libc";
            usesDefaultFeatures = false;
            target = { target, features }: (target."unix" or false);
          }
          {
            name = "wasi";
            packageId = "wasi";
            target = { target, features }: (target."os" == "wasi");
          }
        ];
        features = {
          "bindgen" = [ "dep:bindgen" ];
          "compiler_builtins" = [ "dep:compiler_builtins" ];
          "core" = [ "dep:core" ];
          "js-sys" = [ "dep:js-sys" ];
          "log" = [ "dep:log" ];
          "rustc-dep-of-std" = [ "compiler_builtins" "core" ];
          "stdweb" = [ "dep:stdweb" ];
          "test-in-browser" = [ "wasm-bindgen" ];
          "wasm-bindgen" = [ "bindgen" "js-sys" ];
        };
        resolvedDefaultFeatures = [ "std" ];
      };
      "hmac" = rec {
        crateName = "hmac";
        version = "0.10.1";
        edition = "2018";
        sha256 = "058yxq54x7xn0gk2vy9bl51r32c9z7qlcl2b80bjh3lk3rmiqi61";
        authors = [
          "RustCrypto Developers"
        ];
        dependencies = [
          {
            name = "crypto-mac";
            packageId = "crypto-mac";
          }
          {
            name = "digest";
            packageId = "digest";
          }
        ];
        devDependencies = [
          {
            name = "crypto-mac";
            packageId = "crypto-mac";
            features = [ "dev" ];
          }
        ];
        features = {
          "std" = [ "crypto-mac/std" ];
        };
      };
      "libc" = rec {
        crateName = "libc";
        version = "0.2.121";
        edition = "2015";
        sha256 = "0kzz2l87069gnij2vbw6a1kdjl8pbs4y677jdgmyhprv1wq7papg";
        authors = [
          "The Rust Project Developers"
        ];
        features = {
          "default" = [ "std" ];
          "rustc-dep-of-std" = [ "align" "rustc-std-workspace-core" ];
          "rustc-std-workspace-core" = [ "dep:rustc-std-workspace-core" ];
          "use_std" = [ "std" ];
        };
        resolvedDefaultFeatures = [ "default" "std" ];
      };
      "opaque-debug" = rec {
        crateName = "opaque-debug";
        version = "0.3.0";
        edition = "2018";
        sha256 = "1m8kzi4nd6shdqimn0mgb24f0hxslhnqd1whakyq06wcqd086jk2";
        authors = [
          "RustCrypto Developers"
        ];

      };
      "ppv-lite86" = rec {
        crateName = "ppv-lite86";
        version = "0.2.16";
        edition = "2018";
        sha256 = "0wkqwnvnfcgqlrahphl45vdlgi2f1bs7nqcsalsllp1y4dp9x7zb";
        authors = [
          "The CryptoCorrosion Contributors"
        ];
        features = {
          "default" = [ "std" ];
        };
        resolvedDefaultFeatures = [ "simd" "std" ];
      };
      "rand" = rec {
        crateName = "rand";
        version = "0.7.3";
        edition = "2018";
        sha256 = "00sdaimkbz491qgi6qxkv582yivl32m2jd401kzbn94vsiwicsva";
        authors = [
          "The Rand Project Developers"
          "The Rust Project Developers"
        ];
        dependencies = [
          {
            name = "getrandom";
            packageId = "getrandom";
            rename = "getrandom_package";
            optional = true;
          }
          {
            name = "libc";
            packageId = "libc";
            optional = true;
            usesDefaultFeatures = false;
            target = { target, features }: (target."unix" or false);
          }
          {
            name = "rand_chacha";
            packageId = "rand_chacha";
            usesDefaultFeatures = false;
            target = { target, features }: (!(target."os" == "emscripten"));
          }
          {
            name = "rand_core";
            packageId = "rand_core";
          }
          {
            name = "rand_hc";
            packageId = "rand_hc";
            target = { target, features }: (target."os" == "emscripten");
          }
        ];
        devDependencies = [
          {
            name = "rand_hc";
            packageId = "rand_hc";
          }
        ];
        features = {
          "alloc" = [ "rand_core/alloc" ];
          "default" = [ "std" ];
          "getrandom" = [ "getrandom_package" "rand_core/getrandom" ];
          "getrandom_package" = [ "dep:getrandom_package" ];
          "libc" = [ "dep:libc" ];
          "log" = [ "dep:log" ];
          "nightly" = [ "simd_support" ];
          "packed_simd" = [ "dep:packed_simd" ];
          "rand_pcg" = [ "dep:rand_pcg" ];
          "simd_support" = [ "packed_simd" ];
          "small_rng" = [ "rand_pcg" ];
          "std" = [ "rand_core/std" "rand_chacha/std" "alloc" "getrandom" "libc" ];
          "stdweb" = [ "getrandom_package/stdweb" ];
          "wasm-bindgen" = [ "getrandom_package/wasm-bindgen" ];
        };
        resolvedDefaultFeatures = [ "alloc" "default" "getrandom" "getrandom_package" "libc" "std" ];
      };
      "rand_chacha" = rec {
        crateName = "rand_chacha";
        version = "0.2.2";
        edition = "2018";
        sha256 = "00il36fkdbsmpr99p9ksmmp6dn1md7rmnwmz0rr77jbrca2yvj7l";
        authors = [
          "The Rand Project Developers"
          "The Rust Project Developers"
          "The CryptoCorrosion Contributors"
        ];
        dependencies = [
          {
            name = "ppv-lite86";
            packageId = "ppv-lite86";
            usesDefaultFeatures = false;
            features = [ "simd" ];
          }
          {
            name = "rand_core";
            packageId = "rand_core";
          }
        ];
        features = {
          "default" = [ "std" "simd" ];
          "std" = [ "ppv-lite86/std" ];
        };
        resolvedDefaultFeatures = [ "default" "simd" "std" ];
      };
      "rand_core" = rec {
        crateName = "rand_core";
        version = "0.5.1";
        edition = "2018";
        sha256 = "06bdvx08v3rkz451cm7z59xwwqn1rkfh6v9ay77b14f8dwlybgch";
        authors = [
          "The Rand Project Developers"
          "The Rust Project Developers"
        ];
        dependencies = [
          {
            name = "getrandom";
            packageId = "getrandom";
            optional = true;
          }
        ];
        features = {
          "getrandom" = [ "dep:getrandom" ];
          "serde" = [ "dep:serde" ];
          "serde1" = [ "serde" ];
          "std" = [ "alloc" "getrandom" "getrandom/std" ];
        };
        resolvedDefaultFeatures = [ "alloc" "getrandom" "std" ];
      };
      "rand_hc" = rec {
        crateName = "rand_hc";
        version = "0.2.0";
        edition = "2018";
        sha256 = "0g31sqwpmsirdlwr0svnacr4dbqyz339im4ssl9738cjgfpjjcfa";
        authors = [
          "The Rand Project Developers"
        ];
        dependencies = [
          {
            name = "rand_core";
            packageId = "rand_core";
          }
        ];

      };
      "safemem" = rec {
        crateName = "safemem";
        version = "0.3.3";
        edition = "2015";
        sha256 = "0wp0d2b2284lw11xhybhaszsczpbq1jbdklkxgifldcknmy3nw7g";
        authors = [
          "Austin Bonander <austin.bonander@gmail.com>"
        ];
        features = {
          "default" = [ "std" ];
        };
        resolvedDefaultFeatures = [ "default" "std" ];
      };
      "sha2" = rec {
        crateName = "sha2";
        version = "0.9.9";
        edition = "2018";
        sha256 = "006q2f0ar26xcjxqz8zsncfgz86zqa5dkwlwv03rhx1rpzhs2n2d";
        authors = [
          "RustCrypto Developers"
        ];
        dependencies = [
          {
            name = "block-buffer";
            packageId = "block-buffer";
          }
          {
            name = "cfg-if";
            packageId = "cfg-if";
          }
          {
            name = "cpufeatures";
            packageId = "cpufeatures";
            target = { target, features }: ((target."arch" == "aarch64") || (target."arch" == "x86_64") || (target."arch" == "x86"));
          }
          {
            name = "digest";
            packageId = "digest";
          }
          {
            name = "opaque-debug";
            packageId = "opaque-debug";
          }
        ];
        devDependencies = [
          {
            name = "digest";
            packageId = "digest";
            features = [ "dev" ];
          }
        ];
        features = {
          "asm" = [ "sha2-asm" ];
          "asm-aarch64" = [ "asm" ];
          "default" = [ "std" ];
          "sha2-asm" = [ "dep:sha2-asm" ];
          "std" = [ "digest/std" ];
        };
        resolvedDefaultFeatures = [ "default" "std" ];
      };
      "subtle" = rec {
        crateName = "subtle";
        version = "2.4.1";
        edition = "2015";
        sha256 = "00b6jzh9gzb0h9n25g06nqr90z3xzqppfhhb260s1hjhh4pg7pkb";
        authors = [
          "Isis Lovecruft <isis@patternsinthevoid.net>"
          "Henry de Valence <hdevalence@hdevalence.ca>"
        ];
        features = {
          "default" = [ "std" "i128" ];
        };
        resolvedDefaultFeatures = [ "nightly" "std" ];
      };
      "typenum" = rec {
        crateName = "typenum";
        version = "1.15.0";
        edition = "2018";
        sha256 = "11yrvz1vd43gqv738yw1v75rzngjbs7iwcgzjy3cq5ywkv2imy6w";
        build = "build/main.rs";
        authors = [
          "Paho Lurie-Gregg <paho@paholg.com>"
          "Andre Bogus <bogusandre@gmail.com>"
        ];
        features = {
          "scale-info" = [ "dep:scale-info" ];
          "scale_info" = [ "scale-info/derive" ];
        };
      };
      "version_check" = rec {
        crateName = "version_check";
        version = "0.9.4";
        edition = "2015";
        sha256 = "0gs8grwdlgh0xq660d7wr80x14vxbizmd8dbp29p2pdncx8lp1s9";
        authors = [
          "Sergio Benitez <sb@sergio.bz>"
        ];

      };
      "wasi" = rec {
        crateName = "wasi";
        version = "0.9.0+wasi-snapshot-preview1";
        edition = "2018";
        sha256 = "06g5v3vrdapfzvfq662cij7v8a1flwr2my45nnncdv2galrdzkfc";
        authors = [
          "The Cranelift Project Developers"
        ];
        features = {
          "compiler_builtins" = [ "dep:compiler_builtins" ];
          "core" = [ "dep:core" ];
          "default" = [ "std" ];
          "rustc-dep-of-std" = [ "compiler_builtins" "core" "rustc-std-workspace-alloc" ];
          "rustc-std-workspace-alloc" = [ "dep:rustc-std-workspace-alloc" ];
        };
        resolvedDefaultFeatures = [ "default" "std" ];
      };
      "zeroize" = rec {
        crateName = "zeroize";
        version = "1.3.0";
        edition = "2018";
        sha256 = "1z8yix823b6lz878qwg6bvwhg3lb0cbw3c9yij9p8mbv7zdzfmj7";
        authors = [
          "Tony Arcieri <tony@iqlusion.io>"
        ];
        features = {
          "default" = [ "alloc" ];
          "zeroize_derive" = [ "dep:zeroize_derive" ];
        };
        resolvedDefaultFeatures = [ "alloc" "default" ];
      };
    };

    #
# crate2nix/default.nix (excerpt start)
#

  /* Target (platform) data for conditional dependencies.
    This corresponds roughly to what buildRustCrate is setting.
  */
  defaultTarget = {
    unix = true;
    windows = false;
    fuchsia = true;
    test = false;

    # This doesn't appear to be officially documented anywhere yet.
    # See https://github.com/rust-lang-nursery/rust-forge/issues/101.
    os =
      if stdenv.hostPlatform.isDarwin
      then "macos"
      else stdenv.hostPlatform.parsed.kernel.name;
    arch = stdenv.hostPlatform.parsed.cpu.name;
    family = "unix";
    env = "gnu";
    endian =
      if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian"
      then "little" else "big";
    pointer_width = toString stdenv.hostPlatform.parsed.cpu.bits;
    vendor = stdenv.hostPlatform.parsed.vendor.name;
    debug_assertions = false;
  };

  /* Filters common temp files and build files. */
  # TODO(pkolloch): Substitute with gitignore filter
  sourceFilter = name: type:
    let
      baseName = builtins.baseNameOf (builtins.toString name);
    in
      ! (
        # Filter out git
        baseName == ".gitignore"
        || (type == "directory" && baseName == ".git")

        # Filter out build results
        || (
          type == "directory" && (
            baseName == "target"
            || baseName == "_site"
            || baseName == ".sass-cache"
            || baseName == ".jekyll-metadata"
            || baseName == "build-artifacts"
          )
        )

        # Filter out nix-build result symlinks
        || (
          type == "symlink" && lib.hasPrefix "result" baseName
        )

        # Filter out IDE config
        || (
          type == "directory" && (
            baseName == ".idea" || baseName == ".vscode"
          )
        ) || lib.hasSuffix ".iml" baseName

        # Filter out nix build files
        || baseName == "Cargo.nix"

        # Filter out editor backup / swap files.
        || lib.hasSuffix "~" baseName
        || builtins.match "^\\.sw[a-z]$$" baseName != null
        || builtins.match "^\\..*\\.sw[a-z]$$" baseName != null
        || lib.hasSuffix ".tmp" baseName
        || lib.hasSuffix ".bak" baseName
        || baseName == "tests.nix"
      );

  /* Returns a crate which depends on successful test execution
    of crate given as the second argument.

    testCrateFlags: list of flags to pass to the test exectuable
    testInputs: list of packages that should be available during test execution
  */
  crateWithTest = { crate, testCrate, testCrateFlags, testInputs, testPreRun, testPostRun }:
    assert builtins.typeOf testCrateFlags == "list";
    assert builtins.typeOf testInputs == "list";
    assert builtins.typeOf testPreRun == "string";
    assert builtins.typeOf testPostRun == "string";
    let
      # override the `crate` so that it will build and execute tests instead of
      # building the actual lib and bin targets We just have to pass `--test`
      # to rustc and it will do the right thing.  We execute the tests and copy
      # their log and the test executables to $out for later inspection.
      test =
        let
          drv = testCrate.override
            (
              _: {
                buildTests = true;
              }
            );
          # If the user hasn't set any pre/post commands, we don't want to
          # insert empty lines. This means that any existing users of crate2nix
          # don't get a spurious rebuild unless they set these explicitly.
          testCommand = pkgs.lib.concatStringsSep "\n"
            (pkgs.lib.filter (s: s != "") [
              testPreRun
              "$f $testCrateFlags 2>&1 | tee -a $out"
              testPostRun
            ]);
        in
        pkgs.runCommand "run-tests-${testCrate.name}"
          {
            inherit testCrateFlags;
            buildInputs = testInputs;
          } ''
          set -ex

          export RUST_BACKTRACE=1

          # recreate a file hierarchy as when running tests with cargo

          # the source for test data
          ${pkgs.xorg.lndir}/bin/lndir ${crate.src}

          # build outputs
          testRoot=target/debug
          mkdir -p $testRoot

          # executables of the crate
          # we copy to prevent std::env::current_exe() to resolve to a store location
          for i in ${crate}/bin/*; do
            cp "$i" "$testRoot"
          done
          chmod +w -R .

          # test harness executables are suffixed with a hash, like cargo does
          # this allows to prevent name collision with the main
          # executables of the crate
          hash=$(basename $out)
          for file in ${drv}/tests/*; do
            f=$testRoot/$(basename $file)-$hash
            cp $file $f
            ${testCommand}
          done
        '';
    in
    pkgs.runCommand "${crate.name}-linked"
      {
        inherit (crate) outputs crateName;
        passthru = (crate.passthru or { }) // {
          inherit test;
        };
      } ''
      echo tested by ${test}
      ${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
    '';

  /* A restricted overridable version of builtRustCratesWithFeatures. */
  buildRustCrateWithFeatures =
    { packageId
    , features ? rootFeatures
    , crateOverrides ? defaultCrateOverrides
    , buildRustCrateForPkgsFunc ? null
    , runTests ? false
    , testCrateFlags ? [ ]
    , testInputs ? [ ]
      # Any command to run immediatelly before a test is executed.
    , testPreRun ? ""
      # Any command run immediatelly after a test is executed.
    , testPostRun ? ""
    }:
    lib.makeOverridable
      (
        { features
        , crateOverrides
        , runTests
        , testCrateFlags
        , testInputs
        , testPreRun
        , testPostRun
        }:
        let
          buildRustCrateForPkgsFuncOverriden =
            if buildRustCrateForPkgsFunc != null
            then buildRustCrateForPkgsFunc
            else
              (
                if crateOverrides == pkgs.defaultCrateOverrides
                then buildRustCrateForPkgs
                else
                  pkgs: (buildRustCrateForPkgs pkgs).override {
                    defaultCrateOverrides = crateOverrides;
                  }
              );
          builtRustCrates = builtRustCratesWithFeatures {
            inherit packageId features;