From 70eeba1f481d625db311ea4d961453d3e1b90ea7 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 22 Aug 2020 21:16:26 +0530 Subject: init --- Cargo.lock | 999 ++++++++++++++++++++ Cargo.nix | 2664 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 16 + default.nix | 4 + nix/nixpkgs.nix | 27 + nix/sources.json | 50 + nix/sources.nix | 134 +++ shell.nix | 15 + src/main.rs | 97 ++ 9 files changed, 4006 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.nix create mode 100644 Cargo.toml create mode 100644 default.nix create mode 100644 nix/nixpkgs.nix create mode 100644 nix/sources.json create mode 100644 nix/sources.nix create mode 100644 shell.nix create mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..74c1be3 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,999 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +dependencies = [ + "memchr", +] + +[[package]] +name = "arc-swap" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures-channel" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" + +[[package]] +name = "futures-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" + +[[package]] +name = "futures-task" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +dependencies = [ + "once_cell", +] + +[[package]] +name = "futures-util" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "h2" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" +dependencies = [ + "autocfg 1.0.1", +] + +[[package]] +name = "hedge" +version = "0.1.0" +dependencies = [ + "futures-util", + "hyper", + "nanoid", + "pretty_env_logger", + "rusqlite", + "tokio", + "url", +] + +[[package]] +name = "hermit-abi" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" + +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + +[[package]] +name = "hyper" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project", + "socket2", + "time", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9" +dependencies = [ + "autocfg 1.0.1", + "hashbrown", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3" + +[[package]] +name = "libsqlite3-sys" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a245984b1b06c291f46e27ebda9f369a94a1ab8461d0e845e23f9ced01f5db" +dependencies = [ + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow 0.2.1", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio-named-pipes" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" +dependencies = [ + "log", + "mio", + "miow 0.3.5", + "winapi 0.3.9", +] + +[[package]] +name = "mio-uds" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +dependencies = [ + "iovec", + "libc", + "mio", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "miow" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" +dependencies = [ + "socket2", + "winapi 0.3.9", +] + +[[package]] +name = "nanoid" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6226bc4e142124cb44e309a37a04cd9bb10e740d8642855441d3b14808f635e" +dependencies = [ + "rand", +] + +[[package]] +name = "net2" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" + +[[package]] +name = "pretty_env_logger" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" + +[[package]] +name = "proc-macro-nested" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" + +[[package]] +name = "proc-macro2" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc", + "rand_chacha", + "rand_core 0.4.2", + "rand_hc", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi 0.3.9", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi 0.3.9", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "regex" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", +] + +[[package]] +name = "regex-syntax" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" + +[[package]] +name = "rusqlite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c78c3275d9d6eb684d2db4b2388546b32fdae0586c20a82f3905d21ea78b9ef" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "libsqlite3-sys", + "lru-cache", + "memchr", + "smallvec", +] + +[[package]] +name = "signal-hook-registry" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" +dependencies = [ + "arc-swap", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "smallvec" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" + +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.9", +] + +[[package]] +name = "syn" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d8d6567fe7c7f8835a3a98af4208f3846fba258c1bc3c31d6e506239f11f9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "termcolor" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "tinyvec" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" + +[[package]] +name = "tokio" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "libc", + "memchr", + "mio", + "mio-named-pipes", + "mio-uds", + "num_cpus", + "pin-project-lite", + "signal-hook-registry", + "slab", + "tokio-macros", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" + +[[package]] +name = "tracing" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" +dependencies = [ + "cfg-if", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db63662723c316b43ca36d833707cc93dff82a02ba3d7e354f342682cc8b3545" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +dependencies = [ + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff --git a/Cargo.nix b/Cargo.nix new file mode 100644 index 0000000..0d06dc6 --- /dev/null +++ b/Cargo.nix @@ -0,0 +1,2664 @@ + +# This file was @generated by crate2nix 0.8.0 with the command: +# "generate" +# See https://github.com/kolloch/crate2nix for more info. + +{ nixpkgs ? +, pkgs ? import nixpkgs { config = {}; } +, lib ? pkgs.lib +, stdenv ? pkgs.stdenv +, buildRustCrate ? pkgs.buildRustCrate + # 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 + # Whether to perform release builds: longer compile times, faster binaries. +, release ? true +}: + +rec { + # + # "public" attributes that we attempt to keep stable with new versions of crate2nix. + # + + rootCrate = rec { + packageId = "hedge"; + + # 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; }; + }; + root_crate = + internal.deprecationWarning + "root_crate is deprecated since crate2nix 0.4. Please use rootCrate instead." + rootCrate.build; + # Refer your crate build derivation by name here. + # You can override the features with + # workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }. + workspaceMembers = { + "hedge" = rec { + packageId = "hedge"; + build = internal.buildRustCrateWithFeatures { + packageId = "hedge"; + }; + + # Debug support which might change between releases. + # File a bug if you depend on any for non-debug work! + debug = internal.debugCrate { inherit packageId; }; + }; + }; + workspace_members = + internal.deprecationWarning + "workspace_members is deprecated in crate2nix 0.4. Please use workspaceMembers instead." + lib.mapAttrs (n: v: v.build) workspaceMembers; + + # + # "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 = { + "aho-corasick" = rec { + crateName = "aho-corasick"; + version = "0.7.13"; + edition = "2015"; + sha256 = "11hfmqf90rdvjdpk0x1lixw1s9n08y3fxfy9zqsk0k2wpbc68c84"; + libName = "aho_corasick"; + authors = [ + "Andrew Gallant " + ]; + dependencies = [ + { + name = "memchr"; + packageId = "memchr"; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "std" ]; + "std" = [ "memchr/use_std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "arc-swap" = rec { + crateName = "arc-swap"; + version = "0.4.7"; + edition = "2015"; + sha256 = "0d2hqwpkkz7jflrf3ziy5gpblix0h72x1yalls01a15qss7xh9ad"; + authors = [ + "Michal 'vorner' Vaner " + ]; + features = { + }; + }; + "atty" = rec { + crateName = "atty"; + version = "0.2.14"; + edition = "2015"; + sha256 = "1s7yslcs6a28c5vz7jwj63lkfgyx8mx99fdirlhi9lbhhzhrpcyr"; + authors = [ + "softprops " + ]; + dependencies = [ + { + name = "hermit-abi"; + packageId = "hermit-abi"; + target = { target, features }: (target."os" == "hermit"); + } + { + name = "libc"; + packageId = "libc"; + usesDefaultFeatures = false; + target = { target, features }: target."unix"; + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + target = { target, features }: target."windows"; + features = [ "consoleapi" "processenv" "minwinbase" "minwindef" "winbase" ]; + } + ]; + + }; + "autocfg" = rec { + crateName = "autocfg"; + version = "1.0.1"; + edition = "2015"; + sha256 = "0jj6i9zn4gjl03kjvziqdji6rwx8ykz8zk2ngpc331z2g3fk3c6d"; + authors = [ + "Josh Stone " + ]; + + }; + "bitflags" = rec { + crateName = "bitflags"; + version = "1.2.1"; + edition = "2015"; + sha256 = "14qnd5nq8p2almk79m4m8ydqhd413yaxsyjp5xd19g3mikzf47fg"; + authors = [ + "The Rust Project Developers" + ]; + features = { + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "bytes" = rec { + crateName = "bytes"; + version = "0.5.6"; + edition = "2018"; + sha256 = "0f5s7xq6qzmdh22ygsy8v0sp02m51y0radvq4i4y8cizy1lfqk0f"; + authors = [ + "Carl Lerche " + "Sean McArthur " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "cfg-if" = rec { + crateName = "cfg-if"; + version = "0.1.10"; + edition = "2018"; + sha256 = "08h80ihs74jcyp24cd75wwabygbbdgl05k6p5dmq8akbr78vv1a7"; + authors = [ + "Alex Crichton " + ]; + features = { + "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; + }; + }; + "env_logger" = rec { + crateName = "env_logger"; + version = "0.7.1"; + edition = "2018"; + sha256 = "0djx8h8xfib43g5w94r1m1mkky5spcw4wblzgnhiyg5vnfxknls4"; + authors = [ + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "atty"; + packageId = "atty"; + optional = true; + } + { + name = "humantime"; + packageId = "humantime"; + optional = true; + } + { + name = "log"; + packageId = "log"; + features = [ "std" ]; + } + { + name = "regex"; + packageId = "regex"; + optional = true; + } + { + name = "termcolor"; + packageId = "termcolor"; + optional = true; + } + ]; + features = { + "default" = [ "termcolor" "atty" "humantime" "regex" ]; + }; + resolvedDefaultFeatures = [ "atty" "default" "humantime" "regex" "termcolor" ]; + }; + "fallible-iterator" = rec { + crateName = "fallible-iterator"; + version = "0.2.0"; + edition = "2018"; + sha256 = "1xq759lsr8gqss7hva42azn3whgrbrs2sd9xpn92c5ickxm1fhs4"; + authors = [ + "Steven Fackler " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "fallible-streaming-iterator" = rec { + crateName = "fallible-streaming-iterator"; + version = "0.1.9"; + edition = "2015"; + sha256 = "0nj6j26p71bjy8h42x6jahx1hn0ng6mc2miwpgwnp8vnwqf4jq3k"; + authors = [ + "Steven Fackler " + ]; + features = { + }; + }; + "fnv" = rec { + crateName = "fnv"; + version = "1.0.7"; + edition = "2015"; + sha256 = "1hc2mcqha06aibcaza94vbi81j6pr9a1bbxrxjfhc91zin8yr7iz"; + libPath = "lib.rs"; + authors = [ + "Alex Crichton " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "fuchsia-zircon" = rec { + crateName = "fuchsia-zircon"; + version = "0.3.3"; + edition = "2015"; + sha256 = "10jxc5ks1x06gpd0xg51kcjrxr35nj6qhx2zlc5n7bmskv3675rf"; + authors = [ + "Raph Levien " + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags"; + } + { + name = "fuchsia-zircon-sys"; + packageId = "fuchsia-zircon-sys"; + } + ]; + + }; + "fuchsia-zircon-sys" = rec { + crateName = "fuchsia-zircon-sys"; + version = "0.3.3"; + edition = "2015"; + sha256 = "19zp2085qsyq2bh1gvcxq1lb8w6v6jj9kbdkhpdjrl95fypakjix"; + authors = [ + "Raph Levien " + ]; + + }; + "futures-channel" = rec { + crateName = "futures-channel"; + version = "0.3.5"; + edition = "2018"; + sha256 = "1mb756zxpgrsr0lxkgl358jlpyrwi0i68pnrasj6pjlcq9sasrpk"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + ]; + features = { + "alloc" = [ "futures-core/alloc" ]; + "cfg-target-has-atomic" = [ "futures-core/cfg-target-has-atomic" ]; + "default" = [ "std" ]; + "sink" = [ "futures-sink" ]; + "std" = [ "alloc" "futures-core/std" ]; + "unstable" = [ "futures-core/unstable" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "std" ]; + }; + "futures-core" = rec { + crateName = "futures-core"; + version = "0.3.5"; + edition = "2018"; + sha256 = "16d35ic4b4dkv1gy39cvy2v4391b9014hrxd6vwp3nfm1zwzzxar"; + authors = [ + "Alex Crichton " + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "std" ]; + }; + "futures-macro" = rec { + crateName = "futures-macro"; + version = "0.3.5"; + edition = "2018"; + sha256 = "0f8d4kmdxx0h7nca90zdpnbk429w6d3w8dw2hxrm9ar88c5a7dfh"; + procMacro = true; + authors = [ + "Taylor Cramer " + "Taiki Endo " + ]; + dependencies = [ + { + name = "proc-macro-hack"; + packageId = "proc-macro-hack"; + } + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" ]; + } + ]; + + }; + "futures-sink" = rec { + crateName = "futures-sink"; + version = "0.3.5"; + edition = "2018"; + sha256 = "1k4azaq6x7g9kmpvc91vx5w541y4p340rkl5bnhcfd5p7j4k481z"; + authors = [ + "Alex Crichton " + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "std" ]; + }; + "futures-task" = rec { + crateName = "futures-task"; + version = "0.3.5"; + edition = "2018"; + sha256 = "09m647nghwsg46ckys2846jfga6fbdwgfc08mfqij87215gnpdmx"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "once_cell"; + packageId = "once_cell"; + optional = true; + usesDefaultFeatures = false; + features = [ "std" ]; + } + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" "once_cell" ]; + }; + resolvedDefaultFeatures = [ "alloc" "once_cell" "std" ]; + }; + "futures-util" = rec { + crateName = "futures-util"; + version = "0.3.5"; + edition = "2018"; + sha256 = "1iijrqcamgll0h0r6ww9mh3ln4292c1wghw28h41lw4by17mfr47"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-macro"; + packageId = "futures-macro"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "futures-task"; + packageId = "futures-task"; + usesDefaultFeatures = false; + } + { + name = "pin-project"; + packageId = "pin-project"; + } + { + name = "pin-utils"; + packageId = "pin-utils"; + } + { + name = "proc-macro-hack"; + packageId = "proc-macro-hack"; + optional = true; + } + { + name = "proc-macro-nested"; + packageId = "proc-macro-nested"; + optional = true; + } + { + name = "slab"; + packageId = "slab"; + optional = true; + } + ]; + features = { + "alloc" = [ "futures-core/alloc" "futures-task/alloc" ]; + "async-await-macro" = [ "async-await" "futures-macro" "proc-macro-hack" "proc-macro-nested" ]; + "cfg-target-has-atomic" = [ "futures-core/cfg-target-has-atomic" "futures-task/cfg-target-has-atomic" ]; + "channel" = [ "std" "futures-channel" ]; + "compat" = [ "std" "futures_01" ]; + "default" = [ "std" "async-await" "async-await-macro" ]; + "io" = [ "std" "futures-io" "memchr" ]; + "io-compat" = [ "io" "compat" "tokio-io" ]; + "read-initializer" = [ "io" "futures-io/read-initializer" "futures-io/unstable" ]; + "sink" = [ "futures-sink" ]; + "std" = [ "alloc" "futures-core/std" "futures-task/std" "slab" ]; + "unstable" = [ "futures-core/unstable" "futures-task/unstable" ]; + "write-all-vectored" = [ "io" ]; + }; + resolvedDefaultFeatures = [ "alloc" "async-await" "async-await-macro" "default" "futures-macro" "proc-macro-hack" "proc-macro-nested" "slab" "std" ]; + }; + "h2" = rec { + crateName = "h2"; + version = "0.2.6"; + edition = "2018"; + sha256 = "0lvdrzn43iikl521dlrb7z96lsmy7l6nnm35ylf00q7dmq5rwgwr"; + authors = [ + "Carl Lerche " + "Sean McArthur " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "fnv"; + packageId = "fnv"; + } + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-sink"; + packageId = "futures-sink"; + usesDefaultFeatures = false; + } + { + name = "futures-util"; + packageId = "futures-util"; + usesDefaultFeatures = false; + } + { + name = "http"; + packageId = "http"; + } + { + name = "indexmap"; + packageId = "indexmap"; + } + { + name = "slab"; + packageId = "slab"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "io-util" ]; + } + { + name = "tokio-util"; + packageId = "tokio-util"; + features = [ "codec" ]; + } + { + name = "tracing"; + packageId = "tracing"; + usesDefaultFeatures = false; + features = [ "std" "log" ]; + } + ]; + devDependencies = [ + { + name = "tokio"; + packageId = "tokio"; + features = [ "dns" "macros" "rt-core" "sync" "tcp" ]; + } + ]; + features = { + }; + }; + "hashbrown" = rec { + crateName = "hashbrown"; + version = "0.8.2"; + edition = "2018"; + sha256 = "09cckr5l71ypvfdbvv1qsag4222blixwn9300hpbr831j3vn46z9"; + authors = [ + "Amanieu d'Antras " + ]; + buildDependencies = [ + { + name = "autocfg"; + packageId = "autocfg"; + } + ]; + features = { + "ahash-compile-time-rng" = [ "ahash/compile-time-rng" ]; + "default" = [ "ahash" "inline-more" ]; + "rustc-dep-of-std" = [ "nightly" "core" "compiler_builtins" "alloc" "rustc-internal-api" ]; + }; + resolvedDefaultFeatures = [ "raw" ]; + }; + "hedge" = rec { + crateName = "hedge"; + version = "0.1.0"; + edition = "2018"; + crateBin = [ + { name = "hedge"; path = "src/main.rs"; } + ]; + src = (builtins.filterSource sourceFilter ./.); + authors = [ + "Akshay " + ]; + dependencies = [ + { + name = "futures-util"; + packageId = "futures-util"; + } + { + name = "hyper"; + packageId = "hyper"; + } + { + name = "pretty_env_logger"; + packageId = "pretty_env_logger"; + } + { + name = "rusqlite"; + packageId = "rusqlite"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "full" ]; + } + ]; + + }; + "hermit-abi" = rec { + crateName = "hermit-abi"; + version = "0.1.15"; + edition = "2018"; + sha256 = "1ac5bij39rhzs8zngfxi109dh0h3v0jl5ng8595f9yg7nsbd3vix"; + authors = [ + "Stefan Lankes" + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + usesDefaultFeatures = false; + } + ]; + features = { + "rustc-dep-of-std" = [ "core" "compiler_builtins/rustc-dep-of-std" "libc/rustc-dep-of-std" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "http" = rec { + crateName = "http"; + version = "0.2.1"; + edition = "2018"; + sha256 = "1y827q7j0gvs8z2x12biaik9db6nb902lpqv889cbcj84sbnkm98"; + authors = [ + "Alex Crichton " + "Carl Lerche " + "Sean McArthur " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "fnv"; + packageId = "fnv"; + } + { + name = "itoa"; + packageId = "itoa"; + } + ]; + + }; + "http-body" = rec { + crateName = "http-body"; + version = "0.3.1"; + edition = "2018"; + sha256 = "06qi0ni45lb92w3ml260c0bxbq5zd4snjmz0a9k69xq6021zzm8k"; + authors = [ + "Carl Lerche " + "Lucio Franco " + "Sean McArthur " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "http"; + packageId = "http"; + } + ]; + + }; + "httparse" = rec { + crateName = "httparse"; + version = "1.3.4"; + edition = "2015"; + sha256 = "1yf23ldnjwfkkhkca7f4w15mky9961gjz28dlwyybhphc7l9l5yd"; + authors = [ + "Sean McArthur " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "humantime" = rec { + crateName = "humantime"; + version = "1.3.0"; + edition = "2015"; + sha256 = "0krwgbf35pd46xvkqg14j070vircsndabahahlv3rwhflpy4q06z"; + authors = [ + "Paul Colomiets " + ]; + dependencies = [ + { + name = "quick-error"; + packageId = "quick-error"; + } + ]; + + }; + "hyper" = rec { + crateName = "hyper"; + version = "0.13.7"; + edition = "2018"; + sha256 = "1symcnba2y03b8lj6xp2wd994lk3xyk3wizacjg5s60njzfshs1y"; + authors = [ + "Sean McArthur " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "futures-channel"; + packageId = "futures-channel"; + } + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-util"; + packageId = "futures-util"; + usesDefaultFeatures = false; + } + { + name = "h2"; + packageId = "h2"; + } + { + name = "http"; + packageId = "http"; + } + { + name = "http-body"; + packageId = "http-body"; + } + { + name = "httparse"; + packageId = "httparse"; + } + { + name = "itoa"; + packageId = "itoa"; + } + { + name = "pin-project"; + packageId = "pin-project"; + } + { + name = "socket2"; + packageId = "socket2"; + optional = true; + } + { + name = "time"; + packageId = "time"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "sync" ]; + } + { + name = "tower-service"; + packageId = "tower-service"; + } + { + name = "tracing"; + packageId = "tracing"; + usesDefaultFeatures = false; + features = [ "log" "std" ]; + } + { + name = "want"; + packageId = "want"; + } + ]; + devDependencies = [ + { + name = "futures-util"; + packageId = "futures-util"; + usesDefaultFeatures = false; + features = [ "alloc" ]; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "fs" "macros" "io-std" "rt-util" "sync" "time" "test-util" ]; + } + ]; + features = { + "default" = [ "runtime" "stream" ]; + "runtime" = [ "tcp" "tokio/rt-core" ]; + "tcp" = [ "socket2" "tokio/blocking" "tokio/tcp" "tokio/time" ]; + }; + resolvedDefaultFeatures = [ "default" "runtime" "socket2" "stream" "tcp" ]; + }; + "indexmap" = rec { + crateName = "indexmap"; + version = "1.5.1"; + edition = "2018"; + sha256 = "1y9dmqbwpgh86qqpnb99mllbvlvri39xb3vkz4dv2xkcn5cmxd46"; + authors = [ + "bluss" + "Josh Stone " + ]; + dependencies = [ + { + name = "hashbrown"; + packageId = "hashbrown"; + usesDefaultFeatures = false; + features = [ "raw" ]; + } + ]; + buildDependencies = [ + { + name = "autocfg"; + packageId = "autocfg"; + } + ]; + features = { + "serde-1" = [ "serde" ]; + }; + }; + "iovec" = rec { + crateName = "iovec"; + version = "0.1.4"; + edition = "2015"; + sha256 = "0ph73qygwx8i0mblrf110cj59l00gkmsgrpzz1rm85syz5pymcxj"; + authors = [ + "Carl Lerche " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + target = { target, features }: target."unix"; + } + ]; + + }; + "itoa" = rec { + crateName = "itoa"; + version = "0.4.6"; + edition = "2015"; + sha256 = "1rnpb7rr8df76gnlk07b9086cn7fc0dxxy1ghh00q6nip7bklvyw"; + authors = [ + "David Tolnay " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "kernel32-sys" = rec { + crateName = "kernel32-sys"; + version = "0.2.2"; + edition = "2015"; + sha256 = "1389av0601a9yz8dvx5zha9vmkd6ik7ax0idpb032d28555n41vm"; + libName = "kernel32"; + authors = [ + "Peter Atashian " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi 0.2.8"; + } + ]; + buildDependencies = [ + { + name = "winapi-build"; + packageId = "winapi-build"; + } + ]; + + }; + "lazy_static" = rec { + crateName = "lazy_static"; + version = "1.4.0"; + edition = "2015"; + sha256 = "0in6ikhw8mgl33wjv6q6xfrb5b9jr16q8ygjy803fay4zcisvaz2"; + authors = [ + "Marvin Löbel " + ]; + features = { + "spin_no_std" = [ "spin" ]; + }; + }; + "libc" = rec { + crateName = "libc"; + version = "0.2.76"; + edition = "2015"; + sha256 = "1hvv01y8cjlkg6xqgvflgq4p77p15a83w6xxpcggmrj4w3x5cm3m"; + authors = [ + "The Rust Project Developers" + ]; + features = { + "default" = [ "std" ]; + "rustc-dep-of-std" = [ "align" "rustc-std-workspace-core" ]; + "use_std" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "libsqlite3-sys" = rec { + crateName = "libsqlite3-sys"; + version = "0.20.0"; + edition = "2018"; + sha256 = "1nzm07nrqgz28pld0qc4mfhr96inkzdfn9vfyj8w41hv9fc4b8p3"; + authors = [ + "The rusqlite developers" + ]; + buildDependencies = [ + { + name = "pkg-config"; + packageId = "pkg-config"; + optional = true; + } + { + name = "vcpkg"; + packageId = "vcpkg"; + optional = true; + target = {target, features}: (target."env" == "msvc"); + } + ]; + features = { + "buildtime_bindgen" = [ "bindgen" "pkg-config" "vcpkg" ]; + "bundled" = [ "cc" "bundled_bindings" ]; + "bundled-windows" = [ "cc" "bundled_bindings" ]; + "default" = [ "min_sqlite_version_3_6_8" ]; + "min_sqlite_version_3_6_23" = [ "pkg-config" "vcpkg" ]; + "min_sqlite_version_3_6_8" = [ "pkg-config" "vcpkg" ]; + "min_sqlite_version_3_7_16" = [ "pkg-config" "vcpkg" ]; + "min_sqlite_version_3_7_7" = [ "pkg-config" "vcpkg" ]; + "preupdate_hook" = [ "buildtime_bindgen" ]; + "session" = [ "preupdate_hook" "buildtime_bindgen" ]; + }; + resolvedDefaultFeatures = [ "default" "min_sqlite_version_3_6_8" "pkg-config" "vcpkg" ]; + }; + "linked-hash-map" = rec { + crateName = "linked-hash-map"; + version = "0.5.3"; + edition = "2015"; + sha256 = "0jih3za0p1mywlnwcakc462q1byk6z8vnrzdm36hg6cxk7asdmcd"; + authors = [ + "Stepan Koltsov " + "Andrew Paseltiner " + ]; + features = { + "heapsize_impl" = [ "heapsize" ]; + "serde_impl" = [ "serde" "serde_test" ]; + }; + }; + "log" = rec { + crateName = "log"; + version = "0.4.11"; + edition = "2015"; + sha256 = "12xzqaflpiljn5cmxsbnbv9sjaj13ykhwsvll0gysbx4blbyvasg"; + authors = [ + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + } + ]; + features = { + "kv_unstable_sval" = [ "kv_unstable" "sval/fmt" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "lru-cache" = rec { + crateName = "lru-cache"; + version = "0.1.2"; + edition = "2015"; + sha256 = "071viv6g2p3akwqmfb3c8vsycs5n7kr17b70l7la071jv0d4zqii"; + authors = [ + "Stepan Koltsov " + ]; + dependencies = [ + { + name = "linked-hash-map"; + packageId = "linked-hash-map"; + } + ]; + features = { + "heapsize_impl" = [ "heapsize" "linked-hash-map/heapsize_impl" ]; + }; + }; + "memchr" = rec { + crateName = "memchr"; + version = "2.3.3"; + edition = "2015"; + sha256 = "0074pvsfl938ndl5js14ibc7i9q0k3zp390z843w8nlyv4bxha1p"; + authors = [ + "Andrew Gallant " + "bluss" + ]; + features = { + "default" = [ "std" ]; + "use_std" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" "use_std" ]; + }; + "mio" = rec { + crateName = "mio"; + version = "0.6.22"; + edition = "2015"; + sha256 = "0c64razhyam9892kgxsshmkqs6smrd11087nxb48nhjn4q4lgqzw"; + authors = [ + "Carl Lerche " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "fuchsia-zircon"; + packageId = "fuchsia-zircon"; + target = { target, features }: (target."os" == "fuchsia"); + } + { + name = "fuchsia-zircon-sys"; + packageId = "fuchsia-zircon-sys"; + target = { target, features }: (target."os" == "fuchsia"); + } + { + name = "iovec"; + packageId = "iovec"; + } + { + name = "kernel32-sys"; + packageId = "kernel32-sys"; + target = { target, features }: target."windows"; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: target."unix"; + } + { + name = "log"; + packageId = "log"; + } + { + name = "miow"; + packageId = "miow 0.2.1"; + target = { target, features }: target."windows"; + } + { + name = "net2"; + packageId = "net2"; + } + { + name = "slab"; + packageId = "slab"; + } + { + name = "winapi"; + packageId = "winapi 0.2.8"; + target = { target, features }: target."windows"; + } + ]; + features = { + "default" = [ "with-deprecated" ]; + }; + resolvedDefaultFeatures = [ "default" "with-deprecated" ]; + }; + "mio-named-pipes" = rec { + crateName = "mio-named-pipes"; + version = "0.1.7"; + edition = "2018"; + sha256 = "0mjnjcg5dkb2jwxh4zxx4fgp15wr3hj9r53z4hdm4pnm1z2w2h08"; + authors = [ + "Brendan Molloy " + "Alex Crichton " + ]; + dependencies = [ + { + name = "log"; + packageId = "log"; + target = { target, features }: target."windows"; + } + { + name = "mio"; + packageId = "mio"; + target = { target, features }: target."windows"; + } + { + name = "miow"; + packageId = "miow 0.3.5"; + target = { target, features }: target."windows"; + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + target = { target, features }: target."windows"; + features = [ "winerror" "ioapiset" "minwinbase" "winbase" ]; + } + ]; + + }; + "mio-uds" = rec { + crateName = "mio-uds"; + version = "0.6.8"; + edition = "2015"; + sha256 = "1w36w09gd8as1mah80wdy0kgpshmphmljj68gij34hvdnag6kjxg"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "iovec"; + packageId = "iovec"; + target = { target, features }: target."unix"; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: target."unix"; + } + { + name = "mio"; + packageId = "mio"; + target = { target, features }: target."unix"; + } + ]; + + }; + "miow 0.2.1" = rec { + crateName = "miow"; + version = "0.2.1"; + edition = "2015"; + sha256 = "06g9b8sqlh5gxakwqq4rrib07afwanfnxgxajrldwcgk3hxjy7wc"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "kernel32-sys"; + packageId = "kernel32-sys"; + } + { + name = "net2"; + packageId = "net2"; + usesDefaultFeatures = false; + } + { + name = "winapi"; + packageId = "winapi 0.2.8"; + } + { + name = "ws2_32-sys"; + packageId = "ws2_32-sys"; + } + ]; + + }; + "miow 0.3.5" = rec { + crateName = "miow"; + version = "0.3.5"; + edition = "2018"; + sha256 = "17lpb2754vg6vflk2vgka4kz2p4gkbsgnb815bb3ckaxg6wqzf07"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "socket2"; + packageId = "socket2"; + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + features = [ "std" "fileapi" "handleapi" "ioapiset" "minwindef" "namedpipeapi" "ntdef" "synchapi" "winerror" "winsock2" "ws2def" "ws2ipdef" ]; + } + ]; + + }; + "net2" = rec { + crateName = "net2"; + version = "0.2.34"; + edition = "2015"; + sha256 = "1xsay6x9fqkq34mfyfyavkrk29z7j4wb9fzw5as4yw3nmhcck9rb"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: ((target."os" == "redox") || target."unix" || (target."os" == "wasi")); + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + target = { target, features }: target."windows"; + features = [ "handleapi" "winsock2" "ws2def" "ws2ipdef" "ws2tcpip" ]; + } + ]; + features = { + "default" = [ "duration" ]; + }; + resolvedDefaultFeatures = [ "default" "duration" ]; + }; + "num_cpus" = rec { + crateName = "num_cpus"; + version = "1.13.0"; + edition = "2015"; + sha256 = "1cv6yxhz2zbnwn8pn1yn8grg7zsnd523947fby41a737aqvryj85"; + authors = [ + "Sean McArthur " + ]; + dependencies = [ + { + name = "hermit-abi"; + packageId = "hermit-abi"; + target = { target, features }: (((target."arch" == "x86_64") || (target."arch" == "aarch64")) && (target."os" == "hermit")); + } + { + name = "libc"; + packageId = "libc"; + } + ]; + + }; + "once_cell" = rec { + crateName = "once_cell"; + version = "1.4.1"; + edition = "2018"; + sha256 = "1ba56vr8n85xgajnn78pg6iag4inwil3mqg90wi5jaz6xzkm23i6"; + authors = [ + "Aleksey Kladov " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "pin-project" = rec { + crateName = "pin-project"; + version = "0.4.23"; + edition = "2018"; + sha256 = "1aj8ivjr7bw3dmnp53zj10a0fx6ij3lqx7vx94p38ydfybzk6i6a"; + authors = [ + "Taiki Endo " + ]; + dependencies = [ + { + name = "pin-project-internal"; + packageId = "pin-project-internal"; + usesDefaultFeatures = false; + } + ]; + + }; + "pin-project-internal" = rec { + crateName = "pin-project-internal"; + version = "0.4.23"; + edition = "2018"; + sha256 = "07s66r7c6dirkvcjhqsndaf3qmvwl45c28dgypyk38797rf823ic"; + procMacro = true; + authors = [ + "Taiki Endo " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" "visit-mut" ]; + } + ]; + + }; + "pin-project-lite" = rec { + crateName = "pin-project-lite"; + version = "0.1.7"; + edition = "2018"; + sha256 = "05dp09xswfb18i2jmlvzkb0pd0fin9s3m64fgyksg6161zqxnai8"; + authors = [ + "Taiki Endo " + ]; + + }; + "pin-utils" = rec { + crateName = "pin-utils"; + version = "0.1.0"; + edition = "2018"; + sha256 = "117ir7vslsl2z1a7qzhws4pd01cg2d3338c47swjyvqv2n60v1wb"; + authors = [ + "Josef Brandl " + ]; + + }; + "pkg-config" = rec { + crateName = "pkg-config"; + version = "0.3.18"; + edition = "2015"; + sha256 = "0cxc4yd9qb40944a2svgci41bws68f1hqvyljhrldwbadda94r6k"; + authors = [ + "Alex Crichton " + ]; + + }; + "pretty_env_logger" = rec { + crateName = "pretty_env_logger"; + version = "0.4.0"; + edition = "2015"; + sha256 = "17gva1rlf9fhgr0jr19kv39f8bir3f4pa4jz02qbhl9qanwkcvcj"; + authors = [ + "Sean McArthur " + ]; + dependencies = [ + { + name = "env_logger"; + packageId = "env_logger"; + } + { + name = "log"; + packageId = "log"; + } + ]; + + }; + "proc-macro-hack" = rec { + crateName = "proc-macro-hack"; + version = "0.5.18"; + edition = "2018"; + sha256 = "16055crxm9l5skrl96l5cs6xc4xnvhiggcf625r7pixdl2whbilr"; + procMacro = true; + authors = [ + "David Tolnay " + ]; + + }; + "proc-macro-nested" = rec { + crateName = "proc-macro-nested"; + version = "0.1.6"; + edition = "2015"; + sha256 = "0nnwm9bvp1fmr8nqjp8ynrkj97yzpsdh3062li8b0f4hzgd818gb"; + authors = [ + "David Tolnay " + ]; + + }; + "proc-macro2" = rec { + crateName = "proc-macro2"; + version = "1.0.19"; + edition = "2018"; + sha256 = "04lb4n7g5z9mq6in39i7yb1m5bb107dfawc2rf4227npnn2z1x84"; + authors = [ + "Alex Crichton " + "David Tolnay " + ]; + dependencies = [ + { + name = "unicode-xid"; + packageId = "unicode-xid"; + } + ]; + features = { + "default" = [ "proc-macro" ]; + }; + resolvedDefaultFeatures = [ "default" "proc-macro" ]; + }; + "quick-error" = rec { + crateName = "quick-error"; + version = "1.2.3"; + edition = "2015"; + sha256 = "1q6za3v78hsspisc197bg3g7rpc989qycy8ypr8ap8igv10ikl51"; + authors = [ + "Paul Colomiets " + "Colin Kiegel " + ]; + + }; + "quote" = rec { + crateName = "quote"; + version = "1.0.7"; + edition = "2018"; + sha256 = "0drzd6pq7whq7qhdvvs8wn6pbb0hhc12pz8wv80fb05ixhbksmma"; + authors = [ + "David Tolnay " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "proc-macro" ]; + "proc-macro" = [ "proc-macro2/proc-macro" ]; + }; + resolvedDefaultFeatures = [ "default" "proc-macro" ]; + }; + "redox_syscall" = rec { + crateName = "redox_syscall"; + version = "0.1.57"; + edition = "2015"; + sha256 = "1kh59fpwy33w9nwd5iyc283yglq8pf2s41hnhvl48iax9mz0zk21"; + libName = "syscall"; + authors = [ + "Jeremy Soller " + ]; + + }; + "regex" = rec { + crateName = "regex"; + version = "1.3.9"; + edition = "2015"; + sha256 = "1rnqga94ypykl2apgj26l2j1s9bvr2ix4dlzs323n6abyky80dww"; + authors = [ + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "aho-corasick"; + packageId = "aho-corasick"; + optional = true; + } + { + name = "memchr"; + packageId = "memchr"; + optional = true; + } + { + name = "regex-syntax"; + packageId = "regex-syntax"; + usesDefaultFeatures = false; + } + { + name = "thread_local"; + packageId = "thread_local"; + optional = true; + } + ]; + features = { + "default" = [ "std" "perf" "unicode" "regex-syntax/default" ]; + "perf" = [ "perf-cache" "perf-dfa" "perf-inline" "perf-literal" ]; + "perf-cache" = [ "thread_local" ]; + "perf-literal" = [ "aho-corasick" "memchr" ]; + "unicode" = [ "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" "regex-syntax/unicode" ]; + "unicode-age" = [ "regex-syntax/unicode-age" ]; + "unicode-bool" = [ "regex-syntax/unicode-bool" ]; + "unicode-case" = [ "regex-syntax/unicode-case" ]; + "unicode-gencat" = [ "regex-syntax/unicode-gencat" ]; + "unicode-perl" = [ "regex-syntax/unicode-perl" ]; + "unicode-script" = [ "regex-syntax/unicode-script" ]; + "unicode-segment" = [ "regex-syntax/unicode-segment" ]; + "unstable" = [ "pattern" ]; + "use_std" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "aho-corasick" "default" "memchr" "perf" "perf-cache" "perf-dfa" "perf-inline" "perf-literal" "std" "thread_local" "unicode" "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" ]; + }; + "regex-syntax" = rec { + crateName = "regex-syntax"; + version = "0.6.18"; + edition = "2015"; + sha256 = "1s648w7rwpxnq9iqwbyy43ar4al07906jpz0jxlql23bgjwjwh96"; + authors = [ + "The Rust Project Developers" + ]; + features = { + "default" = [ "unicode" ]; + "unicode" = [ "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" ]; + }; + resolvedDefaultFeatures = [ "default" "unicode" "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" ]; + }; + "rusqlite" = rec { + crateName = "rusqlite"; + version = "0.24.0"; + edition = "2018"; + sha256 = "1vxrg3m22pchyf10mhl60npgsckbaj426jyvsa2bcvlxblkw6y2c"; + authors = [ + "The rusqlite developers" + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags"; + } + { + name = "fallible-iterator"; + packageId = "fallible-iterator"; + } + { + name = "fallible-streaming-iterator"; + packageId = "fallible-streaming-iterator"; + } + { + name = "libsqlite3-sys"; + packageId = "libsqlite3-sys"; + } + { + name = "lru-cache"; + packageId = "lru-cache"; + } + { + name = "memchr"; + packageId = "memchr"; + } + { + name = "smallvec"; + packageId = "smallvec"; + } + ]; + features = { + "array" = [ "vtab" ]; + "backup" = [ "libsqlite3-sys/min_sqlite_version_3_6_23" ]; + "blob" = [ "libsqlite3-sys/min_sqlite_version_3_7_7" ]; + "buildtime_bindgen" = [ "libsqlite3-sys/buildtime_bindgen" ]; + "bundled" = [ "libsqlite3-sys/bundled" "modern_sqlite" ]; + "bundled-full" = [ "array" "backup" "blob" "bundled" "chrono" "collation" "column_decltype" "csvtab" "extra_check" "functions" "hooks" "i128_blob" "limits" "load_extension" "serde_json" "series" "trace" "unlock_notify" "url" "uuid" "vtab" "window" ]; + "bundled-windows" = [ "libsqlite3-sys/bundled-windows" ]; + "csvtab" = [ "csv" "vtab" ]; + "functions" = [ "libsqlite3-sys/min_sqlite_version_3_7_7" ]; + "i128_blob" = [ "byteorder" ]; + "in_gecko" = [ "modern_sqlite" "libsqlite3-sys/in_gecko" ]; + "modern_sqlite" = [ "libsqlite3-sys/bundled_bindings" ]; + "series" = [ "vtab" ]; + "session" = [ "libsqlite3-sys/session" "hooks" ]; + "sqlcipher" = [ "libsqlite3-sys/sqlcipher" ]; + "trace" = [ "libsqlite3-sys/min_sqlite_version_3_6_23" ]; + "unlock_notify" = [ "libsqlite3-sys/unlock_notify" ]; + "vtab" = [ "libsqlite3-sys/min_sqlite_version_3_7_7" "lazy_static" ]; + "wasm32-wasi-vfs" = [ "libsqlite3-sys/wasm32-wasi-vfs" ]; + "window" = [ "functions" ]; + "with-asan" = [ "libsqlite3-sys/with-asan" ]; + }; + }; + "signal-hook-registry" = rec { + crateName = "signal-hook-registry"; + version = "1.2.1"; + edition = "2015"; + sha256 = "0dgh2l7diyhkf74jjyqz1jfsyqsvxgssls30cix6b7jkph823qd3"; + authors = [ + "Michal 'vorner' Vaner " + "Masaki Hara " + ]; + dependencies = [ + { + name = "arc-swap"; + packageId = "arc-swap"; + } + { + name = "libc"; + packageId = "libc"; + } + ]; + + }; + "slab" = rec { + crateName = "slab"; + version = "0.4.2"; + edition = "2015"; + sha256 = "1y59xsa27jk84sxzswjk60xcjf8b4fm5960jwpznrrcmasyva4f1"; + authors = [ + "Carl Lerche " + ]; + + }; + "smallvec" = rec { + crateName = "smallvec"; + version = "1.4.2"; + edition = "2018"; + sha256 = "0lp2ax6hfbcsqa92xkdz8vnlfc0fhpqczv62l64kvgsbp2b7dvpv"; + authors = [ + "The Servo Project Developers" + ]; + features = { + }; + }; + "socket2" = rec { + crateName = "socket2"; + version = "0.3.12"; + edition = "2018"; + sha256 = "062921z4yc29mwzxx982nwd1kb8lnfqyvhncydbf7p3pys9qf203"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + target = { target, features }: (target."unix" || (target."os" == "redox")); + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: (target."unix" || (target."os" == "redox")); + } + { + name = "redox_syscall"; + packageId = "redox_syscall"; + target = { target, features }: (target."os" == "redox"); + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + target = { target, features }: target."windows"; + features = [ "handleapi" "ws2def" "ws2ipdef" "ws2tcpip" "minwindef" ]; + } + ]; + features = { + }; + }; + "syn" = rec { + crateName = "syn"; + version = "1.0.39"; + edition = "2018"; + sha256 = "1y8ikwihdrfn64ybrhaqlbxlcf4g43s8mad36n47yz7ycxjqs7c9"; + authors = [ + "David Tolnay " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + usesDefaultFeatures = false; + } + { + name = "quote"; + packageId = "quote"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "unicode-xid"; + packageId = "unicode-xid"; + } + ]; + features = { + "default" = [ "derive" "parsing" "printing" "clone-impls" "proc-macro" ]; + "printing" = [ "quote" ]; + "proc-macro" = [ "proc-macro2/proc-macro" "quote/proc-macro" ]; + "test" = [ "syn-test-suite/all-features" ]; + }; + resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "full" "parsing" "printing" "proc-macro" "quote" "visit-mut" ]; + }; + "termcolor" = rec { + crateName = "termcolor"; + version = "1.1.0"; + edition = "2018"; + sha256 = "0pyp8vc0gx7124y80ixdl6plbfn1yjhw04i875k5fz2dk8lglsxv"; + authors = [ + "Andrew Gallant " + ]; + dependencies = [ + { + name = "winapi-util"; + packageId = "winapi-util"; + target = { target, features }: target."windows"; + } + ]; + + }; + "thread_local" = rec { + crateName = "thread_local"; + version = "1.0.1"; + edition = "2015"; + sha256 = "054vlrr1vsdy1h4b7n99mr24pnj8928ig9qwzg36wnkld4dns36l"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "lazy_static"; + packageId = "lazy_static"; + } + ]; + + }; + "time" = rec { + crateName = "time"; + version = "0.1.43"; + edition = "2015"; + sha256 = "0f14wrgxj7ya2v4msg5mni7046bsm2angm7cn3pd3yv04gpm12na"; + authors = [ + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + target = { target, features }: target."windows"; + features = [ "std" "minwinbase" "minwindef" "ntdef" "profileapi" "sysinfoapi" "timezoneapi" ]; + } + ]; + devDependencies = [ + { + name = "winapi"; + packageId = "winapi 0.3.9"; + features = [ "std" "processthreadsapi" "winbase" ]; + } + ]; + + }; + "tokio" = rec { + crateName = "tokio"; + version = "0.2.22"; + edition = "2018"; + sha256 = "1kfw5lgq1sswlbxq98j5q45bdxv4hhd907nksysbbwjbv1acld2x"; + authors = [ + "Tokio Contributors " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "fnv"; + packageId = "fnv"; + optional = true; + } + { + name = "futures-core"; + packageId = "futures-core"; + optional = true; + } + { + name = "iovec"; + packageId = "iovec"; + optional = true; + } + { + name = "lazy_static"; + packageId = "lazy_static"; + optional = true; + } + { + name = "libc"; + packageId = "libc"; + optional = true; + target = { target, features }: target."unix"; + } + { + name = "memchr"; + packageId = "memchr"; + optional = true; + } + { + name = "mio"; + packageId = "mio"; + optional = true; + } + { + name = "mio-named-pipes"; + packageId = "mio-named-pipes"; + optional = true; + target = { target, features }: target."windows"; + } + { + name = "mio-uds"; + packageId = "mio-uds"; + optional = true; + target = { target, features }: target."unix"; + } + { + name = "num_cpus"; + packageId = "num_cpus"; + optional = true; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + } + { + name = "signal-hook-registry"; + packageId = "signal-hook-registry"; + optional = true; + target = { target, features }: target."unix"; + } + { + name = "slab"; + packageId = "slab"; + optional = true; + } + { + name = "tokio-macros"; + packageId = "tokio-macros"; + optional = true; + } + { + name = "winapi"; + packageId = "winapi 0.3.9"; + optional = true; + usesDefaultFeatures = false; + target = { target, features }: target."windows"; + } + ]; + features = { + "blocking" = [ "rt-core" ]; + "dns" = [ "rt-core" ]; + "fs" = [ "rt-core" "io-util" ]; + "full" = [ "blocking" "dns" "fs" "io-driver" "io-util" "io-std" "macros" "net" "process" "rt-core" "rt-util" "rt-threaded" "signal" "stream" "sync" "time" ]; + "io-driver" = [ "mio" "lazy_static" ]; + "io-std" = [ "rt-core" ]; + "io-util" = [ "memchr" ]; + "macros" = [ "tokio-macros" ]; + "net" = [ "dns" "tcp" "udp" "uds" ]; + "process" = [ "io-driver" "libc" "mio-named-pipes" "signal" "winapi/consoleapi" "winapi/minwindef" "winapi/threadpoollegacyapiset" "winapi/winerror" ]; + "rt-threaded" = [ "num_cpus" "rt-core" ]; + "signal" = [ "io-driver" "lazy_static" "libc" "mio-uds" "signal-hook-registry" "winapi/consoleapi" "winapi/minwindef" ]; + "stream" = [ "futures-core" ]; + "sync" = [ "fnv" ]; + "tcp" = [ "io-driver" "iovec" ]; + "time" = [ "slab" ]; + "udp" = [ "io-driver" ]; + "uds" = [ "io-driver" "mio-uds" "libc" ]; + }; + resolvedDefaultFeatures = [ "blocking" "default" "dns" "fnv" "fs" "full" "futures-core" "io-driver" "io-std" "io-util" "iovec" "lazy_static" "libc" "macros" "memchr" "mio" "mio-named-pipes" "mio-uds" "net" "num_cpus" "process" "rt-core" "rt-threaded" "rt-util" "signal" "signal-hook-registry" "slab" "stream" "sync" "tcp" "time" "tokio-macros" "udp" "uds" "winapi" ]; + }; + "tokio-macros" = rec { + crateName = "tokio-macros"; + version = "0.2.5"; + edition = "2018"; + sha256 = "1283aq0l7rnh79zzqk4r34dgimvwcymrzmg1yah9ai2nmb3arhzh"; + procMacro = true; + authors = [ + "Tokio Contributors " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" ]; + } + ]; + + }; + "tokio-util" = rec { + crateName = "tokio-util"; + version = "0.3.1"; + edition = "2018"; + sha256 = "16b48dl6sbc9x944jgjvsd65ab1w2c2qcziddbrbwv1b3y4l50my"; + authors = [ + "Tokio Contributors " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "futures-core"; + packageId = "futures-core"; + } + { + name = "futures-sink"; + packageId = "futures-sink"; + } + { + name = "log"; + packageId = "log"; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + } + { + name = "tokio"; + packageId = "tokio"; + } + ]; + devDependencies = [ + { + name = "tokio"; + packageId = "tokio"; + features = [ "full" ]; + } + ]; + features = { + "codec" = [ "tokio/stream" ]; + "compat" = [ "futures-io" ]; + "full" = [ "codec" "udp" "compat" ]; + "udp" = [ "tokio/udp" ]; + }; + resolvedDefaultFeatures = [ "codec" "default" ]; + }; + "tower-service" = rec { + crateName = "tower-service"; + version = "0.3.0"; + edition = "2018"; + sha256 = "0q4q53w82w1wd71x7vbspg2l3jicb6al2w1qdwxmnjrz8jzvd1z9"; + authors = [ + "Tower Maintainers " + ]; + + }; + "tracing" = rec { + crateName = "tracing"; + version = "0.1.19"; + edition = "2018"; + sha256 = "0v3qhqnkmwar0zbkqj5z4achpjl9279xw3v61kinqb833c3clybd"; + authors = [ + "Eliza Weisman " + "Tokio Contributors " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "log"; + packageId = "log"; + optional = true; + } + { + name = "tracing-core"; + packageId = "tracing-core"; + usesDefaultFeatures = false; + } + ]; + devDependencies = [ + { + name = "log"; + packageId = "log"; + } + ]; + features = { + "attributes" = [ "tracing-attributes" ]; + "default" = [ "std" "attributes" ]; + "log-always" = [ "log" ]; + "std" = [ "tracing-core/std" ]; + }; + resolvedDefaultFeatures = [ "log" "std" ]; + }; + "tracing-core" = rec { + crateName = "tracing-core"; + version = "0.1.14"; + edition = "2018"; + sha256 = "0i9mig6849il9wspwgds08mgipwkrh3kg0vdlcyb85n34ckncqyv"; + authors = [ + "Tokio Contributors " + ]; + dependencies = [ + { + name = "lazy_static"; + packageId = "lazy_static"; + optional = true; + } + ]; + features = { + "default" = [ "std" ]; + "std" = [ "lazy_static" ]; + }; + resolvedDefaultFeatures = [ "lazy_static" "std" ]; + }; + "try-lock" = rec { + crateName = "try-lock"; + version = "0.2.3"; + edition = "2015"; + sha256 = "0hkn1ksmg5hdqgqdw1ahy5qk69f4crh2psf0v61qphyrf777nm2r"; + authors = [ + "Sean McArthur " + ]; + + }; + "unicode-xid" = rec { + crateName = "unicode-xid"; + version = "0.2.1"; + edition = "2015"; + sha256 = "0r6mknipyy9vpz8mwmxvkx65ff2ha1n2pxqjj6f46lcn8yrhpzpp"; + authors = [ + "erick.tryzelaar " + "kwantam " + ]; + features = { + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "vcpkg" = rec { + crateName = "vcpkg"; + version = "0.2.10"; + edition = "2015"; + sha256 = "132hlmsc4maava91vl4lh677sl1c7vr8ccl53fnr5w41y6dh4m34"; + authors = [ + "Jim McGrath " + ]; + + }; + "want" = rec { + crateName = "want"; + version = "0.3.0"; + edition = "2018"; + sha256 = "181b2zmwfq389x9n2g1n37cvcvvdand832zz6v8i1l8wrdlaks0w"; + authors = [ + "Sean McArthur " + ]; + dependencies = [ + { + name = "log"; + packageId = "log"; + } + { + name = "try-lock"; + packageId = "try-lock"; + } + ]; + + }; + "winapi 0.2.8" = rec { + crateName = "winapi"; + version = "0.2.8"; + edition = "2015"; + sha256 = "0yh816lh6lf56dpsgxy189c2ai1z3j8mw9si6izqb6wsjkbcjz8n"; + authors = [ + "Peter Atashian " + ]; + + }; + "winapi 0.3.9" = rec { + crateName = "winapi"; + version = "0.3.9"; + edition = "2015"; + sha256 = "06gl025x418lchw1wxj64ycr7gha83m44cjr5sarhynd9xkrm0sw"; + authors = [ + "Peter Atashian " + ]; + dependencies = [ + { + name = "winapi-i686-pc-windows-gnu"; + packageId = "winapi-i686-pc-windows-gnu"; + target = { target, features }: (stdenv.hostPlatform.config == "i686-pc-windows-gnu"); + } + { + name = "winapi-x86_64-pc-windows-gnu"; + packageId = "winapi-x86_64-pc-windows-gnu"; + target = { target, features }: (stdenv.hostPlatform.config == "x86_64-pc-windows-gnu"); + } + ]; + features = { + "debug" = [ "impl-debug" ]; + }; + resolvedDefaultFeatures = [ "consoleapi" "errhandlingapi" "fileapi" "handleapi" "ioapiset" "minwinbase" "minwindef" "namedpipeapi" "ntdef" "processenv" "profileapi" "std" "synchapi" "sysinfoapi" "threadpoollegacyapiset" "timezoneapi" "winbase" "wincon" "winerror" "winnt" "winsock2" "ws2def" "ws2ipdef" "ws2tcpip" ]; + }; + "winapi-build" = rec { + crateName = "winapi-build"; + version = "0.1.1"; + edition = "2015"; + sha256 = "1g4rqsgjky0a7530qajn2bbfcrl2v0zb39idgdws9b1l7gp5wc9d"; + libName = "build"; + authors = [ + "Peter Atashian " + ]; + + }; + "winapi-i686-pc-windows-gnu" = rec { + crateName = "winapi-i686-pc-windows-gnu"; + version = "0.4.0"; + edition = "2015"; + sha256 = "1dmpa6mvcvzz16zg6d5vrfy4bxgg541wxrcip7cnshi06v38ffxc"; + authors = [ + "Peter Atashian " + ]; + + }; + "winapi-util" = rec { + crateName = "winapi-util"; + version = "0.1.5"; + edition = "2018"; + sha256 = "0y71bp7f6d536czj40dhqk0d55wfbbwqfp2ymqf1an5ibgl6rv3h"; + authors = [ + "Andrew Gallant " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi 0.3.9"; + target = { target, features }: target."windows"; + features = [ "std" "consoleapi" "errhandlingapi" "fileapi" "minwindef" "processenv" "winbase" "wincon" "winerror" "winnt" ]; + } + ]; + + }; + "winapi-x86_64-pc-windows-gnu" = rec { + crateName = "winapi-x86_64-pc-windows-gnu"; + version = "0.4.0"; + edition = "2015"; + sha256 = "0gqq64czqb64kskjryj8isp62m2sgvx25yyj3kpc2myh85w24bki"; + authors = [ + "Peter Atashian " + ]; + + }; + "ws2_32-sys" = rec { + crateName = "ws2_32-sys"; + version = "0.2.1"; + edition = "2015"; + sha256 = "0ppscg5qfqaw0gzwv2a4nhn5bn01ff9iwn6ysqnzm4n8s3myz76m"; + libName = "ws2_32"; + authors = [ + "Peter Atashian " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi 0.2.8"; + } + ]; + buildDependencies = [ + { + name = "winapi-build"; + packageId = "winapi-build"; + } + ]; + + }; + }; + + # +# 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 }: + assert builtins.typeOf testCrateFlags == "list"; + assert builtins.typeOf testInputs == "list"; + 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; + } + ); + in + pkgs.runCommand "run-tests-${testCrate.name}" { + inherit testCrateFlags; + buildInputs = testInputs; + } '' + set -ex + cd ${crate.src} + for file in ${drv}/tests/*; do + $file $testCrateFlags 2>&1 | tee -a $out + done + ''; + in + crate.overrideAttrs ( + old: { + checkPhase = '' + test -e ${test} + ''; + passthru = (old.passthru or {}) // { + inherit test; + }; + } + ); + + /* A restricted overridable version of builtRustCratesWithFeatures. */ + buildRustCrateWithFeatures = + { packageId + , features ? rootFeatures + , crateOverrides ? defaultCrateOverrides + , buildRustCrateFunc ? ( + if crateOverrides == pkgs.defaultCrateOverrides + then buildRustCrate + else buildRustCrate.override { + defaultCrateOverrides = crateOverrides; + } + ) + , runTests ? false + , testCrateFlags ? [] + , testInputs ? [] + }: + lib.makeOverridable + ( + { features, crateOverrides, runTests, testCrateFlags, testInputs }: + let + builtRustCrates = builtRustCratesWithFeatures { + inherit packageId features buildRustCrateFunc; + runTests = false; + }; + builtTestRustCrates = builtRustCratesWithFeatures { + inherit packageId features buildRustCrateFunc; + runTests = true; + }; + drv = builtRustCrates.${packageId}; + testDrv = builtTestRustCrates.${packageId}; + in + if runTests then + crateWithTest { + crate = drv; + testCrate = testDrv; + inherit testCrateFlags testInputs; + } + else drv + ) + { inherit features crateOverrides runTests testCrateFlags testInputs; }; + + /* Returns an attr set with packageId mapped to the result of buildRustCrateFunc + for the corresponding crate. + */ + builtRustCratesWithFeatures = + { packageId + , features + , crateConfigs ? crates + , buildRustCrateFunc + , runTests + , target ? defaultTarget + } @ args: + assert (builtins.isAttrs crateConfigs); + assert (builtins.isString packageId); + assert (builtins.isList features); + assert (builtins.isAttrs target); + assert (builtins.isBool runTests); + let + rootPackageId = packageId; + mergedFeatures = mergePackageFeatures ( + args // { + inherit rootPackageId; + target = target // { test = runTests; }; + } + ); + + buildByPackageId = packageId: buildByPackageIdImpl packageId; + + # Memoize built packages so that reappearing packages are only built once. + builtByPackageId = + lib.mapAttrs (packageId: value: buildByPackageId packageId) crateConfigs; + + buildByPackageIdImpl = packageId: + let + features = mergedFeatures."${packageId}" or []; + crateConfig' = crateConfigs."${packageId}"; + crateConfig = + builtins.removeAttrs crateConfig' [ "resolvedDefaultFeatures" "devDependencies" ]; + devDependencies = + lib.optionals + (runTests && packageId == rootPackageId) + (crateConfig'.devDependencies or []); + dependencies = + dependencyDerivations { + inherit builtByPackageId features target; + dependencies = + (crateConfig.dependencies or []) + ++ devDependencies; + }; + buildDependencies = + dependencyDerivations { + inherit builtByPackageId features target; + dependencies = crateConfig.buildDependencies or []; + }; + + filterEnabledDependenciesForThis = dependencies: filterEnabledDependencies { + inherit dependencies features target; + }; + + dependenciesWithRenames = + lib.filter (d: d ? "rename") ( + filterEnabledDependenciesForThis + ( + (crateConfig.buildDependencies or []) + ++ (crateConfig.dependencies or []) + ++ devDependencies + ) + ); + + crateRenames = + builtins.listToAttrs + (map (d: { name = d.name; value = d.rename; }) dependenciesWithRenames); + in + buildRustCrateFunc ( + crateConfig // { + src = crateConfig.src or ( + pkgs.fetchurl { + name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; + url = "https://crates.io/api/v1/crates/${crateConfig.crateName}/${crateConfig.version}/download"; + sha256 = crateConfig.sha256; + } + ); + inherit features dependencies buildDependencies crateRenames release; + } + ); + in + builtByPackageId; + + /* Returns the actual derivations for the given dependencies. */ + dependencyDerivations = + { builtByPackageId + , features + , dependencies + , target + }: + assert (builtins.isAttrs builtByPackageId); + assert (builtins.isList features); + assert (builtins.isList dependencies); + assert (builtins.isAttrs target); + let + enabledDependencies = filterEnabledDependencies { + inherit dependencies features target; + }; + depDerivation = dependency: builtByPackageId.${dependency.packageId}; + in + map depDerivation enabledDependencies; + + /* Returns a sanitized version of val with all values substituted that cannot + be serialized as JSON. + */ + sanitizeForJson = val: + if builtins.isAttrs val + then lib.mapAttrs (n: v: sanitizeForJson v) val + else if builtins.isList val + then builtins.map sanitizeForJson val + else if builtins.isFunction val + then "function" + else val; + + /* Returns various tools to debug a crate. */ + debugCrate = { packageId, target ? defaultTarget }: + assert (builtins.isString packageId); + let + debug = rec { + # The built tree as passed to buildRustCrate. + buildTree = buildRustCrateWithFeatures { + buildRustCrateFunc = lib.id; + inherit packageId; + }; + sanitizedBuildTree = sanitizeForJson buildTree; + dependencyTree = sanitizeForJson ( + buildRustCrateWithFeatures { + buildRustCrateFunc = crate: { + "01_crateName" = crate.crateName or false; + "02_features" = crate.features or []; + "03_dependencies" = crate.dependencies or []; + }; + inherit packageId; + } + ); + mergedPackageFeatures = mergePackageFeatures { + features = rootFeatures; + inherit packageId target; + }; + diffedDefaultPackageFeatures = diffDefaultPackageFeatures { + inherit packageId target; + }; + }; + in + { internal = debug; }; + + /* Returns differences between cargo default features and crate2nix default + features. + + This is useful for verifying the feature resolution in crate2nix. + */ + diffDefaultPackageFeatures = + { crateConfigs ? crates + , packageId + , target + }: + assert (builtins.isAttrs crateConfigs); + let + prefixValues = prefix: lib.mapAttrs (n: v: { "${prefix}" = v; }); + mergedFeatures = + prefixValues + "crate2nix" + (mergePackageFeatures { inherit crateConfigs packageId target; features = [ "default" ]; }); + configs = prefixValues "cargo" crateConfigs; + combined = lib.foldAttrs (a: b: a // b) {} [ mergedFeatures configs ]; + onlyInCargo = + builtins.attrNames + (lib.filterAttrs (n: v: !(v ? "crate2nix") && (v ? "cargo")) combined); + onlyInCrate2Nix = + builtins.attrNames + (lib.filterAttrs (n: v: (v ? "crate2nix") && !(v ? "cargo")) combined); + differentFeatures = lib.filterAttrs + ( + n: v: + (v ? "crate2nix") + && (v ? "cargo") + && (v.crate2nix.features or []) != (v."cargo".resolved_default_features or []) + ) + combined; + in + builtins.toJSON { + inherit onlyInCargo onlyInCrate2Nix differentFeatures; + }; + + /* Returns an attrset mapping packageId to the list of enabled features. + + If multiple paths to a dependency enable different features, the + corresponding feature sets are merged. Features in rust are additive. + */ + mergePackageFeatures = + { crateConfigs ? crates + , packageId + , rootPackageId ? packageId + , features ? rootFeatures + , dependencyPath ? [ crates.${packageId}.crateName ] + , featuresByPackageId ? {} + , target + # Adds devDependencies to the crate with rootPackageId. + , runTests ? false + , ... + } @ args: + assert (builtins.isAttrs crateConfigs); + assert (builtins.isString packageId); + assert (builtins.isString rootPackageId); + assert (builtins.isList features); + assert (builtins.isList dependencyPath); + assert (builtins.isAttrs featuresByPackageId); + assert (builtins.isAttrs target); + assert (builtins.isBool runTests); + let + crateConfig = crateConfigs."${packageId}" or (builtins.throw "Package not found: ${packageId}"); + expandedFeatures = expandFeatures (crateConfig.features or {}) features; + + depWithResolvedFeatures = dependency: + let + packageId = dependency.packageId; + features = dependencyFeatures expandedFeatures dependency; + in + { inherit packageId features; }; + + resolveDependencies = cache: path: dependencies: + assert (builtins.isAttrs cache); + assert (builtins.isList dependencies); + let + enabledDependencies = filterEnabledDependencies { + inherit dependencies target; + features = expandedFeatures; + }; + directDependencies = map depWithResolvedFeatures enabledDependencies; + foldOverCache = op: lib.foldl op cache directDependencies; + in + foldOverCache + ( + cache: { packageId, features }: + let + cacheFeatures = cache.${packageId} or []; + combinedFeatures = sortedUnique (cacheFeatures ++ features); + in + if cache ? ${packageId} && cache.${packageId} == combinedFeatures + then cache + else mergePackageFeatures { + features = combinedFeatures; + featuresByPackageId = cache; + inherit crateConfigs packageId target runTests rootPackageId; + } + ); + + cacheWithSelf = + let + cacheFeatures = featuresByPackageId.${packageId} or []; + combinedFeatures = sortedUnique (cacheFeatures ++ expandedFeatures); + in + featuresByPackageId // { + "${packageId}" = combinedFeatures; + }; + + cacheWithDependencies = + resolveDependencies cacheWithSelf "dep" ( + crateConfig.dependencies or [] + ++ lib.optionals + (runTests && packageId == rootPackageId) + (crateConfig.devDependencies or []) + ); + + cacheWithAll = + resolveDependencies + cacheWithDependencies "build" + (crateConfig.buildDependencies or []); + in + cacheWithAll; + + /* Returns the enabled dependencies given the enabled features. */ + filterEnabledDependencies = { dependencies, features, target }: + assert (builtins.isList dependencies); + assert (builtins.isList features); + assert (builtins.isAttrs target); + + lib.filter + ( + dep: + let + targetFunc = dep.target or (features: true); + in + targetFunc { inherit features target; } + && ( + !(dep.optional or false) + || builtins.any (doesFeatureEnableDependency dep) features + ) + ) + dependencies; + + /* Returns whether the given feature should enable the given dependency. */ + doesFeatureEnableDependency = { name, rename ? null, ... }: feature: + let + prefix = "${name}/"; + len = builtins.stringLength prefix; + startsWithPrefix = builtins.substring 0 len feature == prefix; + in + (rename == null && feature == name) + || (rename != null && rename == feature) + || startsWithPrefix; + + /* Returns the expanded features for the given inputFeatures by applying the + rules in featureMap. + + featureMap is an attribute set which maps feature names to lists of further + feature names to enable in case this feature is selected. + */ + expandFeatures = featureMap: inputFeatures: + assert (builtins.isAttrs featureMap); + assert (builtins.isList inputFeatures); + let + expandFeature = feature: + assert (builtins.isString feature); + [ feature ] ++ (expandFeatures featureMap (featureMap."${feature}" or [])); + outFeatures = builtins.concatMap expandFeature inputFeatures; + in + sortedUnique outFeatures; + + /* + Returns the actual features for the given dependency. + + features: The features of the crate that refers this dependency. + */ + dependencyFeatures = features: dependency: + assert (builtins.isList features); + assert (builtins.isAttrs dependency); + let + defaultOrNil = if dependency.usesDefaultFeatures or true + then [ "default" ] + else []; + explicitFeatures = dependency.features or []; + additionalDependencyFeatures = + let + dependencyPrefix = (dependency.rename or dependency.name) + "/"; + dependencyFeatures = + builtins.filter (f: lib.hasPrefix dependencyPrefix f) features; + in + builtins.map (lib.removePrefix dependencyPrefix) dependencyFeatures; + in + defaultOrNil ++ explicitFeatures ++ additionalDependencyFeatures; + + /* Sorts and removes duplicates from a list of strings. */ + sortedUnique = features: + assert (builtins.isList features); + assert (builtins.all builtins.isString features); + let + outFeaturesSet = lib.foldl (set: feature: set // { "${feature}" = 1; }) {} features; + outFeaturesUnique = builtins.attrNames outFeaturesSet; + in + builtins.sort (a: b: a < b) outFeaturesUnique; + + deprecationWarning = message: value: + if strictDeprecation + then builtins.throw "strictDeprecation enabled, aborting: ${message}" + else builtins.trace message value; + + # + # crate2nix/default.nix (excerpt end) + # + + }; +} diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..3eb3ef1 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "hedge" +version = "0.1.0" +authors = ["Akshay "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +hyper = "0.13" +tokio = { version = "0.2", features = ["full"] } +pretty_env_logger = "0.4" +futures-util = "0.3.5" +rusqlite = "0.24.0" +nanoid = "0.3.0" +url = "2.1.1" diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..fcc28fa --- /dev/null +++ b/default.nix @@ -0,0 +1,4 @@ +{ pkgs ? import ./nix/nixpkgs.nix }: + +let cargoNix = pkgs.callPackage ./Cargo.nix {}; +in cargoNix.rootCrate.build diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix new file mode 100644 index 0000000..b5675fb --- /dev/null +++ b/nix/nixpkgs.nix @@ -0,0 +1,27 @@ + +let + # Manage this with https://github.com/nmattia/niv + # or define { nixpkgs = ...; nixpkgs-mozilla = ...; } + # yourself. + sources = import ./sources.nix; + + rustChannelsOverlay = import "${sources.nixpkgs-mozilla}/rust-overlay.nix"; + # Useful if you also want to provide that in a nix-shell since some rust tools depend + # on that. + rustChannelsSrcOverlay = import "${sources.nixpkgs-mozilla}/rust-src-overlay.nix"; + +in import sources.nixpkgs { + overlays = [ + rustChannelsOverlay + rustChannelsSrcOverlay + (self: super: { + # Replace "latest.rustChannels.stable" with the version of the rust tools that + # you would like. Look at the documentation of nixpkgs-mozilla for examples. + # + # NOTE: "rust" instead of "rustc" is not a typo: It will include more than needed + # but also the much needed "rust-std". + rustc = super.latest.rustChannels.stable.rust; + inherit (super.latest.rustChannels.stable) cargo rust rust-fmt rust-std clippy; + }) + ]; + } diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 0000000..0f22db7 --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,50 @@ +{ + "httpie": { + "branch": "master", + "description": "As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/clihttp", + "homepage": "https://httpie.org", + "owner": "httpie", + "repo": "httpie", + "rev": "100872b5cf493b355453a9dff89f39b0c124d524", + "sha256": "10raamh8ri4b4ir17avvlm5ckaly3755555is14glnfj70sdf25g", + "type": "tarball", + "url": "https://github.com/httpie/httpie/archive/100872b5cf493b355453a9dff89f39b0c124d524.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "niv": { + "branch": "master", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "nmattia", + "repo": "niv", + "rev": "89ae775e9dfc2571f912156dd2f8627e14d4d507", + "sha256": "0ssw6byyn79fpyzswi28s5b85x66xh4xsfhmcfl5mkdxxpmyy0ns", + "type": "tarball", + "url": "https://github.com/nmattia/niv/archive/89ae775e9dfc2571f912156dd2f8627e14d4d507.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "nixos-20.03", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs-channels", + "rev": "64fec31a24b50c774cdc45d4d7fa8d29b79dc165", + "sha256": "101vn3lf87xl9wbhc5qn1xmh13d3dpcass536c960fs3ghanf0h3", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/64fec31a24b50c774cdc45d4d7fa8d29b79dc165.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs-mozilla": { + "branch": "master", + "description": "mozilla related nixpkgs (extends nixos/nixpkgs repo)", + "homepage": null, + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "rev": "efda5b357451dbb0431f983cca679ae3cd9b9829", + "sha256": "11wqrg86g3qva67vnk81ynvqyfj0zxk83cbrf0p9hsvxiwxs8469", + "type": "tarball", + "url": "https://github.com/mozilla/nixpkgs-mozilla/archive/efda5b357451dbb0431f983cca679ae3cd9b9829.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 0000000..8a725cb --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,134 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: spec: + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; } + else + pkgs.fetchurl { inherit (spec) url sha256; }; + + fetch_tarball = pkgs: spec: + if spec.builtin or true then + builtins_fetchTarball { inherit (spec) url sha256; } + else + pkgs.fetchzip { inherit (spec) url sha256; }; + + fetch_git = spec: + builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; + + fetch_builtin-tarball = spec: + builtins.trace + '' + WARNING: + The niv type "builtin-tarball" will soon be deprecated. You should + instead use `builtin = true`. + + $ niv modify -a type=tarball -a builtin=true + '' + builtins_fetchTarball { inherit (spec) url sha256; }; + + fetch_builtin-url = spec: + builtins.trace + '' + WARNING: + The niv type "builtin-url" will soon be deprecated. You should + instead use `builtin = true`. + + $ niv modify -a type=file -a builtin=true + '' + (builtins_fetchurl { inherit (spec) url sha256; }); + + # + # Various helpers + # + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs spec + else if spec.type == "tarball" then fetch_tarball pkgs spec + else if spec.type == "git" then fetch_git spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec + else if spec.type == "builtin-url" then fetch_builtin-url spec + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball { inherit url; } + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl { inherit url; } + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs ( + name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = fetch config.pkgs name spec; } + ) config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? ./sources.json + , sources ? builtins.fromJSON (builtins.readFile sourcesFile) + , pkgs ? mkPkgs sources + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; +in +mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..580f53e --- /dev/null +++ b/shell.nix @@ -0,0 +1,15 @@ +{ + nixpkgs ? ./nix/nixpkgs.nix + , pkgs ? import nixpkgs +}: + +pkgs.mkShell { + buildInputs = [ + pkgs.cargo + pkgs.rustc + pkgs.git + pkgs.shellcheck + pkgs.sqlite + pkgs.httpie + ]; +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..801da3c --- /dev/null +++ b/src/main.rs @@ -0,0 +1,97 @@ +use futures_util::TryStreamExt; +use hyper::service::{make_service_fn, service_fn}; +use hyper::{Body, Method, Request, Response, Server, StatusCode}; +use nanoid::nanoid; +use rusqlite::{params, Connection, OpenFlags, Result, NO_PARAMS}; +use url::form_urlencoded; + +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::str::from_utf8; + +fn shorten>(url: S, conn: &mut Connection) -> Result { + let mut stmt = conn.prepare("select * from urls where link = ?1")?; + let mut rows = stmt.query(params![url.as_ref().to_string()])?; + if let Some(row) = rows.next()? { + return row.get(1); + } else { + let new_id = nanoid!(4); + conn.execute( + "insert into urls (link, shortlink) values (?1, ?2)", + params![url.as_ref().to_string(), new_id], + )?; + return Ok(new_id); + } +} + +fn get_link>(url: S, conn: &mut Connection) -> Result> { + eprintln!("{}", url.as_ref()); + let url = url.as_ref(); + let mut stmt = conn.prepare("select * from urls where shortlink = ?1")?; + let mut rows = stmt.query(params![url.to_string()])?; + if let Some(row) = rows.next()? { + return Ok(row.get(0)?); + } else { + return Ok(None); + } +} + +async fn shortner_service(req: Request) -> Result, hyper::Error> { + let mut conn = init_db("./urls.db_3").unwrap(); + + match req.method() { + &Method::POST => { + let b = hyper::body::to_bytes(req).await?; + let params = form_urlencoded::parse(b.as_ref()) + .into_owned() + .collect::>(); + + if let Some(n) = params.get("shorten") { + let shortlink = shorten(n, &mut conn).unwrap(); + return Ok(Response::new(Body::from(shortlink))); + } else { + return Ok(Response::new(Body::from("invalid form"))); + }; + } + &Method::GET => { + let shortlink = req.uri().path().to_string(); + let link = get_link(&shortlink[1..], &mut conn); + if let Some(l) = link.unwrap() { + return Ok(Response::new(Body::from(l))); + } else { + return Ok(Response::new(Body::from("not found!"))); + } + } + _ => unimplemented!(), + } +} + +fn init_db>(p: P) -> Result { + let conn = Connection::open_with_flags( + p, + OpenFlags::SQLITE_OPEN_CREATE | OpenFlags::SQLITE_OPEN_READ_WRITE, + )?; + conn.execute( + "CREATE TABLE IF NOT EXISTS urls ( + link TEXT PRIMARY KEY, + shortlink TEXT NOT NULL + )", + params![], + )?; + return Ok(conn); +} + +#[tokio::main] +async fn main() -> Result<()> { + let addr = ([127, 0, 0, 1], 3000).into(); + + let service = + make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(shortner_service)) }); + + let server = Server::bind(&addr).serve(service); + + println!("Listening on http://{}", addr); + + server.await.unwrap(); + Ok(()) +} -- cgit v1.2.3