Skip to content

Commit

Permalink
Added dna_hashes to happ
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Sep 26, 2024
1 parent 77b0d54 commit 9bb0df4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/zome_wasm_hash/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ inputs, self, ... }:
{ inputs, ... }:

{
perSystem = { inputs', pkgs, self', lib, ... }: {
Expand Down
6 changes: 3 additions & 3 deletions nix/fixtures/app-repo/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions nix/happ.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build a hApp
{ happManifest, runCommandNoCC, holochain, writeText, json2yaml, callPackage
, runCommandLocal, dnas ? { }, meta }:
{ lib, happManifest, runCommandNoCC, holochain, writeText, json2yaml
, callPackage, runCommandLocal, dnas ? { }, meta }:

let
dnaSrcs = builtins.attrValues dnas;
Expand Down Expand Up @@ -38,6 +38,7 @@ let

in runCommandNoCC manifest.name {
meta = meta // { inherit debug; };
outputs = [ "out" "dna_hashes" ];
srcs = dnaSrcs;
} ''
mkdir workdir
Expand All @@ -52,4 +53,16 @@ in runCommandNoCC manifest.name {
${holochain}/bin/hc app pack workdir
mv workdir/${manifest.name}.happ $out
export DNA_HASHES=
${
builtins.toString (builtins.map (role: ''
export DNA_HASHES=$DNA_HASHES:$(cat ${dnas.${role.name}.hash})
'') manifest'.roles)
}
export DNA_HASHES="''${DNA_HASHES:1}"
echo $DNA_HASHES > $dna_hashes
''

0 comments on commit 9bb0df4

Please sign in to comment.