diff --git a/.github/workflows/all-tests.yml b/.github/workflows/all-tests.yml index 72dcb69..3a4ae59 100644 --- a/.github/workflows/all-tests.yml +++ b/.github/workflows/all-tests.yml @@ -22,6 +22,12 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable + - uses: cachix/cachix-action@v15 + with: + name: holochain-ci + + - uses: Swatinem/rust-cache@v2 + - name: Build Packages run: | nix develop --command make dnas/deepkey.dna diff --git a/Cargo.lock b/Cargo.lock index 40a913a..88944a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -596,8 +596,8 @@ name = "deepkey" version = "0.0.0" dependencies = [ "hc_deepkey_types", - "hdi", - "holo_hash", + "hdi 0.5.0-dev.10", + "holo_hash 0.4.0-dev.9", "rmp-serde", "serde", "serde_bytes", @@ -612,7 +612,7 @@ dependencies = [ "deepkey", "ed25519-dalek", "hc_deepkey_sdk", - "hdk", + "hdk 0.4.0-dev.11", "rand", "rmp-serde", "serde", @@ -1049,27 +1049,45 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hc_deepkey_sdk" -version = "0.7.0-dev.2" +version = "0.7.0-dev.3" dependencies = [ "arbitrary", "hc_deepkey_types", - "hdk", + "hdk 0.3.2", "serde", "serde_bytes", ] [[package]] name = "hc_deepkey_types" -version = "0.8.0-dev.2" +version = "0.8.0-dev.3" dependencies = [ "arbitrary", - "hdi", - "holo_hash", - "holochain_integrity_types", + "hdi 0.4.2", + "holo_hash 0.3.2", + "holochain_integrity_types 0.3.2", "rmpv", "serde", ] +[[package]] +name = "hdi" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece9b147d5e9ebc0a1f47a180a31436f4390a060ad46aa325d1fb851321ec3c7" +dependencies = [ + "getrandom", + "hdk_derive 0.3.2", + "holo_hash 0.3.2", + "holochain_integrity_types 0.3.2", + "holochain_wasmer_guest", + "paste", + "serde", + "serde_bytes", + "tracing", + "tracing-core", +] + [[package]] name = "hdi" version = "0.5.0-dev.10" @@ -1077,9 +1095,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dd62de0d29f215642cb2481ec5cdde81233c3fabe97157c8a35118b69dd821d" dependencies = [ "getrandom", - "hdk_derive", - "holo_hash", - "holochain_integrity_types", + "hdk_derive 0.4.0-dev.10", + "holo_hash 0.4.0-dev.9", + "holochain_integrity_types 0.4.0-dev.10", "holochain_wasmer_guest", "paste", "serde", @@ -1088,6 +1106,26 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "hdk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ba518e916e7eb29cf4a3b4c0d853fefab76bffc19939f8e0e5925581c67da7" +dependencies = [ + "getrandom", + "hdi 0.4.2", + "hdk_derive 0.3.2", + "holo_hash 0.3.2", + "holochain_wasmer_guest", + "holochain_zome_types 0.3.2", + "paste", + "serde", + "serde_bytes", + "thiserror", + "tracing", + "tracing-core", +] + [[package]] name = "hdk" version = "0.4.0-dev.11" @@ -1095,11 +1133,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b63439a2fa623ae819ad41037c00216f1d62dc78aa9e9e5458f987866c08254f" dependencies = [ "getrandom", - "hdi", - "hdk_derive", - "holo_hash", + "hdi 0.5.0-dev.10", + "hdk_derive 0.4.0-dev.10", + "holo_hash 0.4.0-dev.9", "holochain_wasmer_guest", - "holochain_zome_types", + "holochain_zome_types 0.4.0-dev.11", "paste", "serde", "serde_bytes", @@ -1108,6 +1146,22 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "hdk_derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b26f45db67e2619836cd70a880bcf46d40ef844cd838d99ef6008e0f84e86c" +dependencies = [ + "darling 0.14.4", + "heck 0.5.0", + "holochain_integrity_types 0.3.2", + "paste", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "hdk_derive" version = "0.4.0-dev.10" @@ -1116,7 +1170,7 @@ checksum = "fbfd717793514df9e0c44d698e820e68692792fa38c2d721c97c201e5376476e" dependencies = [ "darling 0.14.4", "heck 0.5.0", - "holochain_integrity_types", + "holochain_integrity_types 0.4.0-dev.10", "paste", "proc-macro-error", "proc-macro2", @@ -1144,9 +1198,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "holo_hash" -version = "0.4.0-dev.9" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51425a83caa336a4bd8e6bf4f9b0374ee315fcf4b4c7a103aa2e0c54bb872cad" +checksum = "acfa694a0138aafda54ce76033168cf182158b7628f7e70b12af0ea0ad20d896" dependencies = [ "arbitrary", "base64", @@ -1154,9 +1208,9 @@ dependencies = [ "derive_more", "futures", "holochain_serialized_bytes", - "holochain_util", + "holochain_util 0.3.2", "holochain_wasmer_common", - "kitsune_p2p_dht_arc", + "kitsune_p2p_dht_arc 0.3.2", "must_future", "proptest", "proptest-derive", @@ -1165,25 +1219,45 @@ dependencies = [ "thiserror", ] +[[package]] +name = "holo_hash" +version = "0.4.0-dev.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51425a83caa336a4bd8e6bf4f9b0374ee315fcf4b4c7a103aa2e0c54bb872cad" +dependencies = [ + "base64", + "blake2b_simd", + "derive_more", + "futures", + "holochain_serialized_bytes", + "holochain_util 0.4.0-dev.2", + "holochain_wasmer_common", + "kitsune_p2p_dht_arc 0.4.0-dev.7", + "must_future", + "serde", + "serde_bytes", + "thiserror", +] + [[package]] name = "holochain_deepkey_dna" -version = "0.0.7-dev.1" +version = "0.0.7-dev.2" dependencies = [ "hc_deepkey_sdk", ] [[package]] name = "holochain_integrity_types" -version = "0.4.0-dev.10" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e2d557cc479814090f4724264880ee7ee5e31e5009c98fe23fcc07857ff724" +checksum = "cc3c84cd0ee02fa15e037df4fd81c170cb956792732823416c61b0f4e3d2e177" dependencies = [ "arbitrary", - "holo_hash", - "holochain_secure_primitive", + "holo_hash 0.3.2", + "holochain_secure_primitive 0.3.2", "holochain_serialized_bytes", - "holochain_util", - "kitsune_p2p_timestamp", + "holochain_util 0.3.2", + "kitsune_p2p_timestamp 0.3.2", "proptest", "proptest-derive", "serde", @@ -1192,6 +1266,34 @@ dependencies = [ "tracing", ] +[[package]] +name = "holochain_integrity_types" +version = "0.4.0-dev.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12e2d557cc479814090f4724264880ee7ee5e31e5009c98fe23fcc07857ff724" +dependencies = [ + "holo_hash 0.4.0-dev.9", + "holochain_secure_primitive 0.4.0-dev.1", + "holochain_serialized_bytes", + "holochain_util 0.4.0-dev.2", + "kitsune_p2p_timestamp 0.4.0-dev.2", + "serde", + "serde_bytes", + "subtle", + "tracing", +] + +[[package]] +name = "holochain_nonce" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbbb63a7658f55a0640a04ad675d7dc6979b7eb7f0a889882efa6e9ac95fd606" +dependencies = [ + "getrandom", + "holochain_secure_primitive 0.3.2", + "kitsune_p2p_timestamp 0.3.2", +] + [[package]] name = "holochain_nonce" version = "0.4.0-dev.4" @@ -1199,8 +1301,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d338a69a1d074d7ecc58e028bd3962c98741f5448830b0dcf7a853bbb6515f0" dependencies = [ "getrandom", - "holochain_secure_primitive", - "kitsune_p2p_timestamp", + "holochain_secure_primitive 0.4.0-dev.1", + "kitsune_p2p_timestamp 0.4.0-dev.2", +] + +[[package]] +name = "holochain_secure_primitive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2495193fe4700ccd3fda02acc7f982890938b28deb264c9212df3868efd9e0e" +dependencies = [ + "paste", + "serde", + "subtle", ] [[package]] @@ -1242,6 +1355,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "holochain_util" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df91c909ed1bcf3dfc55db8dfa8361dba9c4e518c80f9cd30b5c00a3e9c84c62" +dependencies = [ + "cfg-if", + "colored", + "dunce", + "futures", + "once_cell", + "tracing", +] + [[package]] name = "holochain_util" version = "0.4.0-dev.2" @@ -1284,6 +1411,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "holochain_zome_types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "526a51ed0b962c2579ff57106fe2dd032a9a1cf2e4820f3dc2f2b37a59b0cc66" +dependencies = [ + "derive_more", + "holo_hash 0.3.2", + "holochain_integrity_types 0.3.2", + "holochain_nonce 0.3.2", + "holochain_serialized_bytes", + "holochain_wasmer_common", + "kitsune_p2p_block 0.3.2", + "kitsune_p2p_timestamp 0.3.2", + "serde", + "serde_bytes", + "subtle", + "thiserror", + "tracing", +] + [[package]] name = "holochain_zome_types" version = "0.4.0-dev.11" @@ -1291,13 +1439,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f62ed18d860b34574edcc76a467e456775142d3e5ca86fb31907f25680cee965" dependencies = [ "derive_more", - "holo_hash", - "holochain_integrity_types", - "holochain_nonce", + "holo_hash 0.4.0-dev.9", + "holochain_integrity_types 0.4.0-dev.10", + "holochain_nonce 0.4.0-dev.4", "holochain_serialized_bytes", "holochain_wasmer_common", - "kitsune_p2p_block", - "kitsune_p2p_timestamp", + "kitsune_p2p_block 0.4.0-dev.9", + "kitsune_p2p_timestamp 0.4.0-dev.2", "serde", "serde_bytes", "subtle", @@ -1418,6 +1566,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kitsune_p2p_bin_data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d57481371cae8f3afdc4f8b0791aa04c70afe375c8678ca2bf966637220b6a" +dependencies = [ + "base64", + "derive_more", + "holochain_util 0.3.2", + "kitsune_p2p_dht_arc 0.3.2", + "serde", + "serde_bytes", + "shrinkwraprs", +] + [[package]] name = "kitsune_p2p_bin_data" version = "0.4.0-dev.9" @@ -1426,21 +1589,46 @@ checksum = "82a36538316e8289894aef8b60b857ea3d05fc8cb447c3bac45f0b22aa9901ce" dependencies = [ "base64", "derive_more", - "holochain_util", - "kitsune_p2p_dht_arc", + "holochain_util 0.4.0-dev.2", + "kitsune_p2p_dht_arc 0.4.0-dev.7", "serde", "serde_bytes", "shrinkwraprs", ] +[[package]] +name = "kitsune_p2p_block" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10105ffc84c408d89a39180460fa9adcfcff09dedb511703efdab050fdbfe40c" +dependencies = [ + "kitsune_p2p_bin_data 0.3.2", + "kitsune_p2p_timestamp 0.3.2", + "serde", +] + [[package]] name = "kitsune_p2p_block" version = "0.4.0-dev.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9caf6d341d99e05c0d1261632d8667f27bad5243889a9675865c6ebce8be975a" dependencies = [ - "kitsune_p2p_bin_data", - "kitsune_p2p_timestamp", + "kitsune_p2p_bin_data 0.4.0-dev.9", + "kitsune_p2p_timestamp 0.4.0-dev.2", + "serde", +] + +[[package]] +name = "kitsune_p2p_dht_arc" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6be19fb54f5f3adb7ef461d51d073f22f3e7343952a31523d04799bceb695ee2" +dependencies = [ + "derive_more", + "gcollections", + "intervallum", + "kitsune_p2p_timestamp 0.3.2", + "num-traits", "serde", ] @@ -1453,16 +1641,16 @@ dependencies = [ "derive_more", "gcollections", "intervallum", - "kitsune_p2p_timestamp", + "kitsune_p2p_timestamp 0.4.0-dev.2", "num-traits", "serde", ] [[package]] name = "kitsune_p2p_timestamp" -version = "0.4.0-dev.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75c6b5bdc4e3a9514c949975ab2a68f977e612bb638bd961ccab948d134af7a" +checksum = "4f0ae9c213de76b54f2a7fcfd1f379b106b45efef1c4365110d7df96a531d69e" dependencies = [ "arbitrary", "chrono", @@ -1473,6 +1661,16 @@ dependencies = [ "serde", ] +[[package]] +name = "kitsune_p2p_timestamp" +version = "0.4.0-dev.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75c6b5bdc4e3a9514c949975ab2a68f977e612bb638bd961ccab948d134af7a" +dependencies = [ + "chrono", + "serde", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -3030,8 +3228,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ac21545e93b405717f6aa5f5a5a1a2c9611ed78836fb7ecaff3be6fb84eb48" dependencies = [ - "hdi", - "holo_hash", + "hdi 0.5.0-dev.10", + "holo_hash 0.4.0-dev.9", "serde", ] @@ -3041,7 +3239,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ce917b5c5692b97611e2c93079de34290fcfbe7f45582318207c3adf86a493d" dependencies = [ - "hdk", + "hdk 0.4.0-dev.11", "serde", "thiserror", "whi_hdi_extensions", diff --git a/Cargo.toml b/Cargo.toml index b2b232a..de228be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ members = [ [workspace.dependencies] serde = "1" rmp-serde = "1" +rmpv = { version = "1", features = ["with-serde"] } serde_bytes = "0.11" hc_deepkey_types = { version = "0.8.0-dev.2", path = "dnas/deepkey/types" } hc_deepkey_sdk = { version = "0.7.0-dev.2", path = "dnas/deepkey/sdk" } diff --git a/crates/holochain_deepkey_dna/Cargo.toml b/crates/holochain_deepkey_dna/Cargo.toml index f414405..2046f5c 100644 --- a/crates/holochain_deepkey_dna/Cargo.toml +++ b/crates/holochain_deepkey_dna/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "holochain_deepkey_dna" -version = "0.0.7-dev.1" +version = "0.0.7-dev.2" edition = "2021" authors = ["Michael dougherty "] license = "CAL-1.0" @@ -14,7 +14,7 @@ name = "holochain_deepkey_dna" path = "src/lib.rs" [dependencies] -hc_deepkey_sdk = { version = "0.7.0-dev.2", path = "../../dnas/deepkey/sdk" } +hc_deepkey_sdk = { version = "0.7.0-dev.3", path = "../../dnas/deepkey/sdk" } [features] fuzzing = ["hc_deepkey_sdk/fuzzing"] diff --git a/dnas/deepkey/sdk/Cargo.toml b/dnas/deepkey/sdk/Cargo.toml index 3c6c208..8f11c80 100644 --- a/dnas/deepkey/sdk/Cargo.toml +++ b/dnas/deepkey/sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hc_deepkey_sdk" -version = "0.7.0-dev.2" +version = "0.7.0-dev.3" authors = ["Matthew Brisebois "] edition = "2021" license = "CAL-1.0" @@ -13,10 +13,12 @@ name = "deepkey_sdk" crate-type = ["cdylib", "rlib"] [dependencies] -hc_deepkey_types = { version = "0.8.0-dev.2", path = "../types" } -hdk = "=0.4.0-dev.11" -serde = "1" -serde_bytes = "0.11" +hc_deepkey_types = { version = "0.8.0-dev.3", path = "../types" } +# Any Holochain dependencies specified here should be "*" versions to allow the consumer +# to pick the version they want to use. +hdk = "*" +serde = { workspace = true } +serde_bytes = { workspace = true } arbitrary = { version = "1.0", features = ["derive"], optional = true } @@ -24,4 +26,4 @@ arbitrary = { version = "1.0", features = ["derive"], optional = true } fuzzing = [ "arbitrary", "hc_deepkey_types/fuzzing", -] \ No newline at end of file +] diff --git a/dnas/deepkey/sdk/src/lib.rs b/dnas/deepkey/sdk/src/lib.rs index 2de53b9..466f87f 100644 --- a/dnas/deepkey/sdk/src/lib.rs +++ b/dnas/deepkey/sdk/src/lib.rs @@ -3,7 +3,7 @@ pub use deepkey_types::*; pub use hdk; -use hdk::prelude::{holo_hash::DnaHash, *}; +use hdk::prelude::*; use serde_bytes::ByteArray; #[hdk_entry_helper] diff --git a/dnas/deepkey/types/Cargo.toml b/dnas/deepkey/types/Cargo.toml index 3c7865d..0c7e21a 100644 --- a/dnas/deepkey/types/Cargo.toml +++ b/dnas/deepkey/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hc_deepkey_types" -version = "0.8.0-dev.2" +version = "0.8.0-dev.3" authors = ["Matthew Brisebois "] edition = "2021" license = "CAL-1.0" @@ -13,14 +13,16 @@ name = "deepkey_types" crate-type = ["cdylib", "rlib"] [dependencies] -hdi = "=0.5.0-dev.10" -holo_hash = { version = "=0.4.0-dev.9", features = ["hashing", "encoding"] } -holochain_integrity_types = "=0.4.0-dev.10" -rmpv = { version = "1", features = ["with-serde"] } -serde = "1" +# Any Holochain dependencies specified here should be "*" versions to allow the consumer +# to pick the version they want to use. +hdi = "*" +holo_hash = { version = "*", features = ["hashing", "encoding"] } +holochain_integrity_types = "*" -arbitrary = { version = "1.0", features = ["derive"], optional = true } +rmpv = { workspace = true } +serde = { workspace = true } +arbitrary = { version = "1.0", features = ["derive"], optional = true } [features] fuzzing = [ @@ -28,4 +30,4 @@ fuzzing = [ # "hdi/fuzzing", "holochain_integrity_types/fuzzing", "holo_hash/fuzzing", -] \ No newline at end of file +] diff --git a/dnas/deepkey/types/src/app_binding.rs b/dnas/deepkey/types/src/app_binding.rs index ca415f2..2e0de93 100644 --- a/dnas/deepkey/types/src/app_binding.rs +++ b/dnas/deepkey/types/src/app_binding.rs @@ -2,7 +2,6 @@ use crate::{ MetaData, }; use hdi::prelude::*; -use holo_hash::DnaHash; #[hdk_entry_helper] diff --git a/flake.lock b/flake.lock index 9a771ac..8a80a48 100644 --- a/flake.lock +++ b/flake.lock @@ -1,56 +1,197 @@ { "nodes": { - "flake-utils": { + "crane": { "inputs": { - "systems": "systems" + "nixpkgs": [ + "holonix", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1721058578, + "narHash": "sha256-fs/PVa3H5dS1//4BjecWi3nitXm5fRObx0JxXIAo+JA=", + "owner": "ipetkov", + "repo": "crane", + "rev": "17e5109bb1d9fb393d70fba80988f7d70d1ded1a", "type": "github" }, "original": { - "id": "flake-utils", - "type": "indirect" + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "hc-launch": { + "flake": false, + "locked": { + "lastModified": 1720810416, + "narHash": "sha256-PgykEezr0yrUAPQcmVJdR8M4PiKDzLCL/RS67RFeu/A=", + "owner": "holochain", + "repo": "hc-launch", + "rev": "b788d346491f4749949ae1710d51508920b6ea07", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "holochain-weekly", + "repo": "hc-launch", + "type": "github" + } + }, + "hc-scaffold": { + "flake": false, + "locked": { + "lastModified": 1723558677, + "narHash": "sha256-s5WjtXlu8d7U/zY2Kv4daaH0TlSiVc+D+UqR6B7+qj4=", + "owner": "holochain", + "repo": "scaffolding", + "rev": "80edba8c2f5512ba0babcc8d84b78c1d79f0d1d8", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "holochain-weekly", + "repo": "scaffolding", + "type": "github" + } + }, + "holochain": { + "flake": false, + "locked": { + "lastModified": 1723718736, + "narHash": "sha256-f8Hi7HvANahU5lJjtWk+XpnCcIjfMiV0yFxGqzqEXqU=", + "owner": "holochain", + "repo": "holochain", + "rev": "a3384305850735b1b71fa0ab6f36f2318ec56d28", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "holochain-0.4.0-dev.18", + "repo": "holochain", + "type": "github" + } + }, + "holonix": { + "inputs": { + "crane": "crane", + "flake-parts": "flake-parts", + "hc-launch": "hc-launch", + "hc-scaffold": "hc-scaffold", + "holochain": "holochain", + "lair-keystore": "lair-keystore", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1723737493, + "narHash": "sha256-zP22A91tT/i+chslSATQvjKrZTXelwTcDqeNTLLTcyc=", + "owner": "holochain", + "repo": "holonix", + "rev": "6438098657b9441e65db1543f0200f22453238de", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "main", + "repo": "holonix", + "type": "github" + } + }, + "lair-keystore": { + "flake": false, + "locked": { + "lastModified": 1717684904, + "narHash": "sha256-vcXt67Tl1qwVUkx8CBevdQocqZXUEeoXjaYw86ljsYo=", + "owner": "holochain", + "repo": "lair", + "rev": "6a84ed490fc7074d107e38bbb4a8d707e9b8e066", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "lair_keystore-v0.4.5", + "repo": "lair", + "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1722640603, - "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", - "owner": "NixOS", + "lastModified": 1717179513, + "narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", + "rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", + "owner": "nixos", + "ref": "24.05", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1719876945, + "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" + } + }, "root": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "flake-parts": [ + "holonix", + "flake-parts" + ], + "holonix": "holonix", + "nixpkgs": [ + "holonix", + "nixpkgs" + ] } }, - "systems": { + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "holonix", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1721269159, + "narHash": "sha256-eHrGuKZKQb762qdCkrfoyyxXLKumYhiXJca1ig0RftE=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "c3e217122ac55680606d69bc693bdf262f14f602", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "oxalica", + "repo": "rust-overlay", "type": "github" } } diff --git a/flake.nix b/flake.nix index 6afbcd9..682d950 100644 --- a/flake.nix +++ b/flake.nix @@ -1,40 +1,40 @@ { - description = "Holochain Development Env"; + description = "Flake for Holochain app development"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + holonix = { + url = "github:holochain/holonix?ref=main"; + inputs = { + holochain.url = "github:holochain/holochain?ref=holochain-0.4.0-dev.18"; + }; + }; + + nixpkgs.follows = "holonix/nixpkgs"; + flake-parts.follows = "holonix/flake-parts"; }; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import ./pkgs.nix { - pkgs = nixpkgs.legacyPackages.${system}; - inherit system; - }; - in - { - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - holochain_0-4 - lair-keystore_0-4-5 - hc_0-4 + outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + systems = builtins.attrNames inputs.holonix.devShells; + perSystem = { inputs', pkgs, ... }: { + formatter = pkgs.nixpkgs-fmt; - rustup - cargo - rustc + devShells.default = pkgs.mkShell { + inputsFrom = [ inputs'.holonix.devShells ]; - nodejs_22 - ]; + packages = (with inputs'.holonix.packages; [ + holochain + lair-keystore + hn-introspect + rust # For Rust development, with the WASM target included for zome builds + ]) ++ (with pkgs; [ + nodejs_20 # For UI development + # Add any other packages you need here + ]); - shellHook = '' - export PS1="\[\e[1;32m\](flake-env)\[\e[0m\] \[\e[1;34m\]\u@\h:\w\[\e[0m\]$ " - export CARGO_HOME=$(pwd)/.cargo - export RUSTUP_HOME=$(pwd)/.rustup - rustup default stable - rustup target add wasm32-unknown-unknown - ''; - }; - } - ); + shellHook = '' + export PS1='\[\033[1;34m\][holonix:\w]\$\[\033[0m\] ' + ''; + }; + }; + }; }