From 99edc66cbb2167cd2c98aefc8d4ec11d90d80cc5 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Tue, 5 Mar 2024 13:45:41 +0100 Subject: [PATCH] WIP --- flake.nix | 8 +++++++- nix/dna.nix | 3 +++ nix/happ.nix | 3 +++ nix/zome.nix | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index f674095..30a6236 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,13 @@ } { flake = { - lib = { + lib = rec { + filterByHolochainPackageType = holochainPackageType: packages: inputs.nixpkgs.lib.filterAttrs (key: value: value.meta.holochainPackageType == holochainPackageType) packages; + + filterZomes = filterByHolochainPackageType "zome"; + filterDnas = filterByHolochainPackageType "dna"; + filterHapps = filterByHolochainPackageType "happ"; + rustZome = { cratePath, holochain, workspacePath, optimizeWasm ? true, excludedCrates ? [] }: let system = holochain.devShells.holonix.system; diff --git a/nix/dna.nix b/nix/dna.nix index 4ddc4dd..f27178d 100644 --- a/nix/dna.nix +++ b/nix/dna.nix @@ -45,4 +45,7 @@ in hc dna pack workdir mv workdir/${manifest.name}.dna $out ''; + meta = { + holochainPackageType = "dna"; + }; } diff --git a/nix/happ.nix b/nix/happ.nix index 218e009..c758203 100644 --- a/nix/happ.nix +++ b/nix/happ.nix @@ -42,4 +42,7 @@ in hc app pack workdir mv workdir/${manifest.name}.happ $out ''; + meta = { + holochainPackageType = "happ"; + }; } diff --git a/nix/zome.nix b/nix/zome.nix index 8cadcd1..65229c1 100644 --- a/nix/zome.nix +++ b/nix/zome.nix @@ -50,6 +50,6 @@ in cp ${wasm}/lib/${crate}.wasm $out ''; meta = { - holochainType = "zome"; + holochainPackageType = "zome"; }; }