Skip to content

Commit

Permalink
Refactor builders
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Sep 26, 2024
1 parent 109f920 commit c093289
Show file tree
Hide file tree
Showing 24 changed files with 352 additions and 396 deletions.
173 changes: 76 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/compare_dnas_integrity/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
commonArgs = {
src = craneLib.cleanCargoSource (craneLib.path ../../.);
doCheck = false;
buildInputs = self.lib.holochainDeps { inherit pkgs lib; };
buildInputs = self'.dependencies.holochain.buildInputs;
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
pname = "t-nesh-workspace";
Expand Down
11 changes: 3 additions & 8 deletions crates/nix_scaffolding_utils/fixture/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@
inputs = {
nixpkgs.follows = "holochain/nixpkgs";

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

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

outputs = inputs@{ ... }:
inputs.holochain.inputs.flake-parts.lib.mkFlake { inherit inputs; } {
inputs.holonix.inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ./dna.nix ];

systems = builtins.attrNames inputs.holochain.devShells;
systems = builtins.attrNames inputs.holonix.devShells;
perSystem = { inputs', config, pkgs, system, lib, self', ... }: { };
};
}
3 changes: 3 additions & 0 deletions crates/scaffold_remote_zome/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ path-clean = "1"
dialoguer = "0.11"
colored = "2.1.0"
holochain_types = "0.3.2"

[dev-dependencies]
pretty_assertions = "1.4.1"
2 changes: 1 addition & 1 deletion crates/scaffold_remote_zome/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
commonArgs = {
src = craneLib.cleanCargoSource (craneLib.path ../../.);
doCheck = false;
buildInputs = self.lib.holochainDeps { inherit pkgs lib; };
buildInputs = self'.dependencies.holochain.buildInputs;
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
pname = "t-nesh-workspace";
Expand Down
20 changes: 6 additions & 14 deletions crates/scaffold_remote_zome/fixture/dna.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{ inputs, ... }:

{
perSystem =
{ inputs'
, self'
, lib
, ...
}: {
packages.forum = inputs.hc-infra.outputs.lib.dna {
dnaManifest = ./dna.yaml;
holochain = inputs'.holochain;
zomes = {

};
};
};
perSystem = { inputs', self', lib, system, ... }: {
packages.forum = inputs.hc-infra.outputs.builders.${system}.dna {
dnaManifest = ./dna.yaml;
zomes = { };
};
};
}

13 changes: 4 additions & 9 deletions crates/scaffold_remote_zome/fixture/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
description = "Template for Holochain app development";

inputs = {
nixpkgs.follows = "holochain/nixpkgs";
nixpkgs.follows = "holonix/nixpkgs";

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

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

outputs = inputs@{ ... }:
inputs.holochain.inputs.flake-parts.lib.mkFlake { inherit inputs; } {
inputs.holonix.inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ./dna.nix ];

systems = builtins.attrNames inputs.holochain.devShells;
systems = builtins.attrNames inputs.holonix.devShells;
perSystem = { inputs', config, pkgs, system, lib, self', ... }: { };
};
}
48 changes: 17 additions & 31 deletions crates/scaffold_remote_zome/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ fn find_nixified_dnas(file_tree: &FileTree) -> Result<Vec<NixifiedDna>, Scaffold
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
use build_fs_tree::{dir, file};
use file_tree_utils::file_content;

Expand Down Expand Up @@ -426,19 +427,14 @@ coordinator:
inputs = {
profiles.url = "github:holochain-open-dev/profiles/nixify";
nixpkgs.follows = "holochain/nixpkgs";
nixpkgs.follows = "holonix/nixpkgs";
versions.url = "github:holochain/holochain?dir=versions/weekly";
holochain = {
url = "github:holochain/holochain";
inputs.versions.follows = "versions";
};
holonix.url = "github:holochain/holonix";
hc-infra.url = "github:holochain-open-dev/utils";
};
outputs = inputs @ { ... }:
inputs.holochain.inputs.flake-parts.lib.mkFlake
inputs.holonix.inputs.flake-parts.lib.mkFlake
{
inherit inputs;
}
Expand All @@ -447,7 +443,7 @@ coordinator:
./dna.nix
];
systems = builtins.attrNames inputs.holochain.devShells;
systems = builtins.attrNames inputs.holonix.devShells;
perSystem =
{ inputs'
, config
Expand All @@ -460,7 +456,7 @@ coordinator:
devShells.default = pkgs.mkShell {
inputsFrom = [
inputs'.hc-infra.devShells.synchronized-pnpm
inputs'.holochain.devShells.holonix
inputs'.holonix.devShells.default
];
};
};
Expand All @@ -477,20 +473,19 @@ coordinator:
perSystem =
{ inputs'
, self'
, system
, ...
}: {
packages.my_dna = inputs.hc-infra.outputs.lib.dna {
packages.my_dna = inputs.hc-infra.outputs.builders.${system}.dna {
dnaManifest = ./dna.yaml;
holochain = inputs'.holochain;
zomes = {
profiles_integrity = inputs'.profiles.packages.profiles_integrity;
profiles = inputs'.profiles.packages.profiles;
};
};
packages.another_dna = inputs.hc-infra.outputs.lib.dna {
packages.another_dna = inputs.hc-infra.outputs.builders.${system}.dna {
dnaManifest = ./workdir/dna.yaml;
holochain = inputs'.holochain;
zomes = {
};
};
Expand Down Expand Up @@ -533,31 +528,23 @@ coordinator:
description = "Template for Holochain app development";
inputs = {
nixpkgs.follows = "holochain/nixpkgs";
versions.url = "github:holochain/holochain?dir=versions/weekly";
nixpkgs.follows = "holonix/nixpkgs";
holochain = {
url = "github:holochain/holochain";
inputs.versions.follows = "versions";
};
holonix.url = "github:holochain/holonix";
hc-infra.url = "github:holochain-open-dev/utils";
};
outputs = inputs @ { ... }:
inputs.holochain.inputs.flake-parts.lib.mkFlake
inputs.holonix.inputs.flake-parts.lib.mkFlake
{
inherit inputs;
specialArgs = {
rootPath = ./.;
};
}
{
imports = [
./dna.nix
];
systems = builtins.attrNames inputs.holochain.devShells;
systems = builtins.attrNames inputs.holonix.devShells;
perSystem =
{ inputs'
, config
Expand All @@ -570,7 +557,7 @@ coordinator:
devShells.default = pkgs.mkShell {
inputsFrom = [
inputs'.hc-infra.devShells.synchronized-pnpm
inputs'.holochain.devShells.holonix
inputs'.holonix.devShells.default
];
};
};
Expand All @@ -588,18 +575,17 @@ coordinator:
perSystem =
{ inputs'
, self'
, system
, ...
}: {
packages.my_dna = inputs.hc-infra.outputs.lib.dna {
packages.my_dna = inputs.hc-infra.outputs.builders.${system}.dna {
dnaManifest = ./dna.yaml;
holochain = inputs'.holochain;
zomes = {
};
};
packages.another_dna = inputs.hc-infra.outputs.lib.dna {
packages.another_dna = inputs.hc-infra.outputs.builders.${system}.dna {
dnaManifest = ./workdir/dna.yaml;
holochain = inputs'.holochain;
zomes = {
};
};
Expand Down
2 changes: 1 addition & 1 deletion crates/sync_npm_git_dependencies_with_nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
commonArgs = {
src = craneLib.cleanCargoSource (craneLib.path ../../.);
doCheck = false;
buildInputs = self.lib.holochainDeps { inherit pkgs lib; };
buildInputs = self'.dependencies.holochain.buildInputs;
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
pname = "t-nesh-workspace";
Expand Down
2 changes: 1 addition & 1 deletion crates/zome_wasm_hash/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
commonArgs = {
src = craneLib.cleanCargoSource (craneLib.path ../../.);
doCheck = false;
buildInputs = self.lib.holochainDeps { inherit pkgs lib; };
buildInputs = self'.dependencies.holochain.buildInputs;
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
pname = "t-nesh-workspace";
Expand Down
Loading

0 comments on commit c093289

Please sign in to comment.