Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZSF - work in progress #9

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .devenv.flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
inputs = {
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devenv.url = "github:cachix/devenv?dir=src/modules";
} // (if builtins.pathExists ./.devenv/flake.json
then builtins.fromJSON (builtins.readFile ./.devenv/flake.json)
else {});

outputs = { nixpkgs, ... }@inputs:
let
devenv = if builtins.pathExists ./.devenv/devenv.json
then builtins.fromJSON (builtins.readFile ./.devenv/devenv.json)
else {};
getOverlays = inputName: inputAttrs:
map (overlay: let
input = inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays.");
in input.overlays.${overlay} or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${nixpkgs.lib.concatStringsSep ", " (builtins.attrNames input.overlays)}"))
inputAttrs.overlays or [];
overlays = nixpkgs.lib.flatten (nixpkgs.lib.mapAttrsToList getOverlays (devenv.inputs or {}));
pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = devenv.allowUnfree or false;
permittedInsecurePackages = devenv.permittedInsecurePackages or [];
};
inherit overlays;
};
lib = pkgs.lib;
importModule = path:
if lib.hasPrefix "./" path
then ./. + (builtins.substring 1 255 path) + "/devenv.nix"
else if lib.hasPrefix "../" path
then throw "devenv: ../ is not supported for imports"
else let
paths = lib.splitString "/" path;
name = builtins.head paths;
input = inputs.${name} or (throw "Unknown input ${name}");
subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}";
devenvpath = "${input}" + subpath + "/devenv.nix";
in if builtins.pathExists devenvpath
then devenvpath
else throw (devenvpath + " file does not exist for input ${name}.");
project = pkgs.lib.evalModules {
specialArgs = inputs // { inherit inputs pkgs; };
modules = [
(inputs.devenv.modules + /top-level.nix)
{ devenv.cliVersion = "0.6.3"; }
] ++ (map importModule (devenv.imports or [])) ++ [
./devenv.nix
(devenv.devenv or {})
(if builtins.pathExists ./devenv.local.nix then ./devenv.local.nix else {})
];
};
config = project.config;

options = pkgs.nixosOptionsDoc {
options = builtins.removeAttrs project.options [ "_module" ];
# Unpack Nix types, e.g. literalExpression, mDoc.
transformOptions =
let isDocType = v: builtins.elem v [ "literalDocBook" "literalExpression" "literalMD" "mdDoc" ];
in lib.attrsets.mapAttrs (_: v:
if v ? _type && isDocType v._type then
v.text
else if v ? _type && v._type == "derivation" then
v.name
else
v
);
};
in {
packages."x86_64-linux" = {
optionsJSON = options.optionsJSON;
inherit (config) info procfileScript procfileEnv procfile;
ci = config.ciDerivation;
};
devenv.containers = config.containers;
devShell."x86_64-linux" = config.shell;
};
}
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="

use devenv
95 changes: 76 additions & 19 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,14 @@ dependencies = [
"regex",
]

[[package]]
name = "equihash"
version = "0.2.0"
dependencies = [
"blake2b_simd",
"byteorder",
]

[[package]]
name = "equihash"
version = "0.2.0"
Expand Down Expand Up @@ -1395,6 +1403,13 @@ dependencies = [
"once_cell",
]

[[package]]
name = "f4jumble"
version = "0.1.0"
dependencies = [
"blake2b_simd",
]

[[package]]
name = "f4jumble"
version = "0.1.0"
Expand Down Expand Up @@ -5490,15 +5505,13 @@ checksum = "bce173f1d9ed4f806e310bc3a873301531e7a6dc209928584d6404e3f8228ef4"
dependencies = [
"bech32",
"bs58",
"f4jumble",
"zcash_encoding",
"f4jumble 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "zcash_client_backend"
version = "0.10.0-rc.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecc33f71747a93d509f7e1c047961e359a271bdf4869cc07f7f65ee1ba7df8c2"
version = "0.9.0"
dependencies = [
"base64 0.21.7",
"bech32",
Expand All @@ -5521,10 +5534,18 @@ dependencies = [
"tonic-build",
"tracing",
"which",
"zcash_address",
"zcash_encoding",
"zcash_address 0.3.0",
"zcash_encoding 0.2.0",
"zcash_note_encryption",
"zcash_primitives",
"zcash_primitives 0.13.0-rc.1",
]

[[package]]
name = "zcash_encoding"
version = "0.2.0"
dependencies = [
"byteorder",
"nonempty",
]

[[package]]
Expand Down Expand Up @@ -5561,6 +5582,37 @@ dependencies = [
"subtle",
]

[[package]]
name = "zcash_primitives"
version = "0.13.0-rc.1"
dependencies = [
"aes",
"bip0039",
"bitvec",
"blake2b_simd",
"blake2s_simd",
"bls12_381",
"byteorder",
"equihash 0.2.0",
"ff",
"fpe",
"group",
"hex",
"incrementalmerkletree",
"jubjub",
"lazy_static",
"memuse",
"nonempty",
"orchard",
"rand 0.8.5",
"rand_core 0.6.4",
"sha2",
"subtle",
"zcash_address 0.3.0",
"zcash_encoding 0.2.0",
"zcash_note_encryption",
]

[[package]]
name = "zcash_primitives"
version = "0.13.0-rc.1"
Expand All @@ -5574,7 +5626,7 @@ dependencies = [
"blake2s_simd",
"bls12_381",
"byteorder",
"equihash",
"equihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ff",
"fpe",
"group",
Expand All @@ -5592,8 +5644,8 @@ dependencies = [
"secp256k1",
"sha2",
"subtle",
"zcash_address",
"zcash_encoding",
"zcash_address 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_note_encryption",
]

Expand All @@ -5615,7 +5667,7 @@ dependencies = [
"redjubjub",
"tracing",
"xdg",
"zcash_primitives",
"zcash_primitives 0.13.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand Down Expand Up @@ -5648,10 +5700,10 @@ dependencies = [
"subtle",
"syn 1.0.109",
"tracing",
"zcash_address",
"zcash_encoding",
"zcash_address 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_note_encryption",
"zcash_primitives",
"zcash_primitives 0.13.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_proofs",
]

Expand All @@ -5672,7 +5724,7 @@ dependencies = [
"criterion",
"displaydoc",
"ed25519-zebra",
"equihash",
"equihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"futures",
"group",
"halo2_proofs",
Expand Down Expand Up @@ -5708,12 +5760,17 @@ dependencies = [
"tracing",
"uint",
"x25519-dalek",
<<<<<<< HEAD
"zcash_address",
"zcash_client_backend",
"zcash_encoding",
=======
"zcash_address 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zcash_encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
>>>>>>> 0af6f4eb (update librustzcash)
"zcash_history",
"zcash_note_encryption",
"zcash_primitives",
"zcash_primitives 0.13.0-rc.1",
"zebra-test",
]

Expand Down Expand Up @@ -5852,7 +5909,7 @@ dependencies = [
"tokio",
"tower",
"tracing",
"zcash_address",
"zcash_address 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zebra-chain",
"zebra-consensus",
"zebra-network",
Expand Down Expand Up @@ -5886,7 +5943,7 @@ dependencies = [
"tracing",
"zcash_client_backend",
"zcash_note_encryption",
"zcash_primitives",
"zcash_primitives 0.13.0-rc.1",
"zebra-chain",
"zebra-grpc",
"zebra-node-services",
Expand Down
Loading