-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bf3d97
commit 1c81d47
Showing
21 changed files
with
201 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nator-zome/dnas/{{dna_role_name}}/zomes/coordinator/{{zome_manifest.name}}/Cargo.toml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...dinator-zome/dnas/{{dna_role_name}}/zomes/coordinator/{{zome_manifest.name}}/zome.nix.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ inputs, rootPath, ... }: | ||
|
||
{ | ||
perSystem = | ||
{ inputs' | ||
, self' | ||
, ... | ||
}: { | ||
packages.{{zome_manifest.name}} = inputs.hcUtils.outputs.lib.rustZome { | ||
workspacePath = rootPath; | ||
holochain = inputs'.holochain; | ||
crateCargoTomlPath = ./Cargo.toml; | ||
}; | ||
|
||
# Test only this zome and its integrity in isolation | ||
checks.{{zome_manifest.name }}= inputs.hcUtils.outputs.lib.sweettest { | ||
workspacePath = rootPath; | ||
holochain = inputs'.holochain; | ||
dna = inputs.hcUtils.outputs.lib.dna { | ||
dnaManifest = '' | ||
--- | ||
manifest_version: "1" | ||
name: test_dna | ||
integrity: | ||
network_seed: ~ | ||
properties: ~ | ||
origin_time: 1709638576394039 | ||
zomes: | ||
- name: {{zome_manifest.name}}_integrity | ||
coordinator: | ||
zomes: | ||
- name: my_zome | ||
hash: ~ | ||
dependencies: | ||
- {{zome_manifest.name}}_integrity | ||
dylib: ~ | ||
''; | ||
zomes = inputs.hcUtils.outputs.lib.filterZomes self'.packages; | ||
holochain = inputs'.holochain; | ||
}; | ||
crateCargoTomlPath = ./Cargo.toml; | ||
}; | ||
|
||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ inputs, holochainSources, ... }: | ||
|
||
{ | ||
# Import all ./zomes/coordinator/*/zome.nix and ./zomes/integrity/*/zome.nix | ||
imports = ( | ||
map (m: "${./.}/zomes/coordinator/${m}/zome.nix") | ||
(builtins.attrNames (builtins.readDir ./zomes/coordinator)) | ||
) | ||
++ | ||
( | ||
map (m: "${./.}/zomes/integrity/${m}/zome.nix") | ||
(builtins.attrNames (builtins.readDir ./zomes/integrity)) | ||
) | ||
; | ||
perSystem = | ||
{ inputs' | ||
, self' | ||
, lib | ||
, ... | ||
}: { | ||
packages.{{dna_name}} = inputs.hcUtils.outputs.lib.dna { | ||
dnaManifestPath = ./workdir/dna.yaml; | ||
holochain = inputs'.holochain; | ||
zomes = inputs.hcUtils.outputs.lib.filterZomes ( | ||
inputs.nixpkgs.lib.attrsets.mergeAttrsList ( | ||
[ self'.packages ] | ||
++ builtins.map (s: s.packages) holochainSources inputs' | ||
) # Merge all the holochain packages from this repository with the holochain sources repositories | ||
) // { | ||
# Override specific zomes here, e.g.: | ||
# profiles_integrity = inputs'.profiles.packages.profiles_integrity; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
..._role_name}}/zomes/integrity/{{replace zome_manifest.name "_integrity" "" }}/zome.nix.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ inputs, rootPath, ... }: | ||
|
||
{ | ||
perSystem = | ||
{ inputs' | ||
, ... | ||
}: { | ||
packages.{{zome_manifest.name}} = inputs.hcUtils.outputs.lib.rustZome { | ||
workspacePath = rootPath; | ||
holochain = inputs'.holochain; | ||
crateCargoTomlPath = ./Cargo.toml; | ||
}; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,56 @@ | ||
{{#merge previous_file_content}} | ||
{{#match_scope "inputs = {"}} | ||
{{previous_scope_content}} | ||
{ | ||
description = "Template for Holochain app development"; | ||
|
||
scaffolding.url = "github:holochain-open-dev/templates"; | ||
{{/match_scope}} | ||
{{#match_scope "devShells.default = pkgs.mkShell {"}} | ||
inputs = { | ||
versions.url = "github:holochain/holochain?dir=versions/weekly"; | ||
|
||
inputsFrom = [ inputs'.holochain-flake.devShells.holonix ]; | ||
holochain.url = "github:holochain/holochain"; | ||
holochain.inputs.versions.follows = "versions"; | ||
|
||
nixpkgs.follows = "holochain/nixpkgs"; | ||
flake-parts.follows = "holochain/flake-parts"; | ||
|
||
scaffolding.url = "github:holochain-open-dev/templates"; | ||
hcUtils.url = "github:holochain-open-dev/common"; | ||
|
||
# hApp dependencies | ||
profiles.url = "github:holochain-open-dev/profiles/nixify"; | ||
}; | ||
|
||
outputs = inputs: | ||
inputs.flake-parts.lib.mkFlake | ||
{ | ||
inherit inputs; | ||
specialArgs.rootPath = ./.; | ||
# All the repositories that output zomes, dnas or happs packages | ||
specialArgs.holochainSources = inputs': with inputs'; [ | ||
profiles | ||
# Add more here | ||
]; | ||
} | ||
{ | ||
imports = [ | ||
./happ.nix | ||
]; | ||
|
||
systems = builtins.attrNames inputs.holochain.devShells; | ||
perSystem = | ||
{ inputs' | ||
, config | ||
, pkgs | ||
, system | ||
, ... | ||
}: { | ||
devShells.default = pkgs.mkShell { | ||
inputsFrom = [ inputs'.holochain.devShells.holonix ]; | ||
|
||
packages = with pkgs; [ | ||
nodejs_20 | ||
cargo-nextest | ||
] ++ [ | ||
inputs'.scaffolding.packages.hc-scaffold-app-template | ||
]; | ||
{{/match_scope}} | ||
{{/merge}} | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ inputs, holochainSources, ... }: | ||
|
||
{ | ||
# Import all `dnas/*/dna.nix` files | ||
imports = ( | ||
map (m: "${./.}/dnas/${m}/dna.nix") | ||
(builtins.attrNames (if builtins.pathExists ./dnas then builtins.readDir ./dnas else {} )) | ||
); | ||
|
||
perSystem = | ||
{ inputs' | ||
, lib | ||
, self' | ||
, ... | ||
}: { | ||
packages.{{snake_case app_name}} = inputs.hcUtils.outputs.lib.happ { | ||
holochain = inputs'.holochain; | ||
happManifestPath = ./workdir/happ.yaml; | ||
dnas = inputs.hcUtils.outputs.lib.filterDnas ( | ||
inputs.nixpkgs.lib.attrsets.mergeAttrsList ( | ||
[ self'.packages ] | ||
++ builtins.map (s: s.packages) holochainSources inputs' | ||
) # Merge all the holochain packages from this repository with the holochain sources repositories | ||
) // { | ||
# Override specific dnas here, e.g.: | ||
# my_dna = inputs'.some_input.packages.my_dna; | ||
}; | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
export const appPath = | ||
dirname(fileURLToPath(import.meta.url)) + '/../../workdir/{{snake_case app_name}}-debug.happ'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nator-zome/dnas/{{dna_role_name}}/zomes/coordinator/{{zome_manifest.name}}/Cargo.toml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.