Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Sep 2, 2024
1 parent ed38fcf commit 3284d28
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 307 deletions.
359 changes: 95 additions & 264 deletions flake.lock

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
description = "Template for Holochain app development";

inputs = {
versions.url = "github:holochain/holochain?dir=versions/0_3";
holochain.url = "github:holochain/holochain";
holochain.inputs.versions.follows = "versions";

nixpkgs.follows = "holochain/nixpkgs";
flake-parts.follows = "holochain/flake-parts";
holonix.url = "github:holochain/holonix/main-0.3";
nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";
scaffolding.url = "github:holochain/scaffolding/holochain-0.3";
};

Expand All @@ -18,12 +15,12 @@
];
};

outputs = inputs@{ flake-parts, holochain, ... }:
outputs = inputs@{ flake-parts, holonix, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.attrNames holochain.devShells;
systems = builtins.attrNames holonix.devShells;
perSystem = { config, pkgs, system, inputs', ... }: {
devShells.default = pkgs.mkShell {
inputsFrom = [ holochain.devShells.${system}.holonix ];
inputsFrom = [ holonix.devShells.${system}.default ];

packages = with pkgs; [ nodejs_20 ];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
, ...
}: {
packages.{{zome_manifest.name}} = inputs.hc-infra.outputs.lib.rustZome {
inherit system;
workspacePath = inputs.self.outPath;
holochain = inputs'.holochain;
crateCargoToml = ./Cargo.toml;
cargoArtifacts =
inputs.hc-infra.outputs.lib.zomeCargoArtifacts { inherit system; };
};

# Test only this zome and its integrity in isolation
checks.{{zome_manifest.name }}= inputs.hc-infra.outputs.lib.sweettest {
inherit system;
workspacePath = inputs.self.outPath;
holochain = inputs'.holochain;
dna = (inputs.hc-infra.outputs.lib.dna {
dnaManifest = builtins.toFile "dna.yaml" ''
---
Expand Down
3 changes: 2 additions & 1 deletion templates/app/dna/dnas/{{dna_name}}/dna.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
{ inputs'
, self'
, lib
, system
, ...
}: {
packages.{{dna_name}} = inputs.hc-infra.outputs.lib.dna {
inherit system;
dnaManifest = ./workdir/dna.yaml;
holochain = inputs'.holochain;
zomes = {
# Include here the zome packages for this DNA, e.g.:
# profiles_integrity = inputs'.profiles.packages.profiles_integrity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
, ...
}: {
packages.{{zome_manifest.name}} = inputs.hc-infra.outputs.lib.rustZome {
inherit system;
workspacePath = inputs.self.outPath;
holochain = inputs'.holochain;
crateCargoToml = ./Cargo.toml;
cargoArtifacts =
inputs.hc-infra.outputs.lib.zomeCargoArtifacts { inherit system; };
Expand Down
22 changes: 7 additions & 15 deletions templates/app/web-app/flake.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@
description = "Template for Holochain app development";

inputs = {
versions.url = "github:holochain/holochain?dir=versions/0_3";
holonix.url = "github:holochain/holonix/main-0.3";

holochain.url = "github:holochain/holochain";
holochain.inputs.versions.follows = "versions";

nixpkgs.follows = "holochain/nixpkgs";
flake-parts.follows = "holochain/flake-parts";

hc-infra = {
url = "github:holochain-open-dev/infrastructure";
};
scaffolding = {
url = "github:holochain-open-dev/templates";
};
nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";

hc-infra.url = "github:holochain-open-dev/infrastructure";
scaffolding.url = "github:holochain-open-dev/templates";
};

outputs = inputs:
Expand All @@ -29,7 +21,7 @@
./happ.nix
];

systems = builtins.attrNames inputs.holochain.devShells;
systems = builtins.attrNames inputs.holonix.devShells;
perSystem =
{ inputs'
, config
Expand All @@ -40,7 +32,7 @@
devShells.default = pkgs.mkShell {
inputsFrom = [
inputs'.hc-infra.devShells.synchronized-pnpm
inputs'.holochain.devShells.holonix
inputs'.holonix.devShells.default
];
packages = [
inputs'.scaffolding.packages.hc-scaffold-app-template
Expand Down
3 changes: 2 additions & 1 deletion templates/app/web-app/happ.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
{ inputs'
, lib
, self'
, system
, ...
}: {
packages.{{app_name}} = inputs.hc-infra.outputs.lib.happ {
holochain = inputs'.holochain;
inherit system;
happManifest = ./workdir/happ.yaml;
dnas = {
# Include here the DNA packages for this hApp, e.g.:
Expand Down
13 changes: 5 additions & 8 deletions templates/zome/web-app/flake.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
description = "Template for Holochain app development";

inputs = {
versions.url = "github:holochain/holochain?dir=versions/0_3";
holonix.url = "github:holochain/holonix/main-0.3";

holochain.url = "github:holochain/holochain";
holochain.inputs.versions.follows = "versions";

nixpkgs.follows = "holochain/nixpkgs";
flake-parts.follows = "holochain/flake-parts";
nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";

hc-infra.url = "github:holochain-open-dev/infrastructure";
scaffolding.url = "github:holochain-open-dev/templates";
Expand Down Expand Up @@ -40,7 +37,7 @@
./workdir/happ.nix
];

systems = builtins.attrNames inputs.holochain.devShells;
systems = builtins.attrNames inputs.holonix.devShells;
perSystem =
{ inputs'
, config
Expand All @@ -51,7 +48,7 @@
devShells.default = pkgs.mkShell {
inputsFrom = [
inputs'.hc-infra.devShells.synchronized-pnpm
inputs'.holochain.devShells.holonix
inputs'.holonix.devShells.default
];

packages = [
Expand Down
3 changes: 2 additions & 1 deletion templates/zome/web-app/workdir/dna.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
{ inputs'
, self'
, lib
, system
, ...
}: {
packages.{{app_name}}_test_dna = inputs.hc-infra.outputs.lib.dna {
inherit system;
dnaManifest = ./dna.yaml;
holochain = inputs'.holochain;
zomes = {
# Include here the zome packages for this DNA, e.g.:
profiles_integrity = inputs'.profiles.packages.profiles_integrity;
Expand Down
3 changes: 2 additions & 1 deletion templates/zome/web-app/workdir/happ.nix.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
{ inputs'
, lib
, self'
, system
, ...
}: {
packages.{{snake_case app_name}}_test_happ = inputs.hc-infra.outputs.lib.happ {
holochain = inputs'.holochain;
inherit system;
happManifest = ./happ.yaml;

dnas = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
, ...
}: rec {
packages.{{snake_case app_name}} = inputs.hc-infra.outputs.lib.rustZome {
inherit system;
workspacePath = inputs.self.outPath;
holochain = inputs'.holochain;
crateCargoToml = ./Cargo.toml;
cargoArtifacts =
inputs.hc-infra.outputs.lib.zomeCargoArtifacts { inherit system; };
};

# Test only this zome and its integrity in isolation
checks.{{snake_case app_name}} = inputs.hc-infra.outputs.lib.sweettest {
inherit system;
workspacePath = inputs.self.outPath;
holochain = inputs'.holochain;
dna = (inputs.hc-infra.outputs.lib.dna {
dnaManifest = builtins.toFile "dna.yaml" ''
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{
perSystem =
{ inputs'
, system
, system
, ...
}: {
packages.{{snake_case app_name}}_integrity = inputs.hc-infra.outputs.lib.rustZome {
inherit system;
workspacePath = inputs.self.outPath;
holochain = inputs'.holochain;
crateCargoToml = ./Cargo.toml;
cargoArtifacts =
inputs.hc-infra.outputs.lib.zomeCargoArtifacts { inherit system; };
Expand Down

0 comments on commit 3284d28

Please sign in to comment.