diff --git a/flake.nix b/flake.nix index c4d76b2..83c4a95 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ filterDnas = filterByHolochainPackageType "dna"; filterHapps = filterByHolochainPackageType "happ"; - rustZome = { crateCargoTomlPath, holochain, workspacePath, excludedCrates ? [] }: + rustZome = { crateCargoToml, holochain, workspacePath, excludedCrates ? [] }: let system = holochain.devShells.holonix.system; pkgs = import inputs.nixpkgs { @@ -50,9 +50,9 @@ in pkgs.callPackage ./nix/zome.nix { - inherit craneLib crateCargoTomlPath excludedCrates workspacePath; - }; - sweettest = { holochain, dna, workspacePath, crateCargoTomlPath }: + inherit craneLib crateCargoToml excludedCrates workspacePath; + }; + sweettest = { holochain, dna, workspacePath, crateCargoToml }: let system = holochain.devShells.holonix.system; pkgs = import inputs.nixpkgs { @@ -66,43 +66,29 @@ }; craneLib = inputs.crane.lib.${system}.overrideToolchain rustToolchain; in pkgs.callPackage ./nix/sweettest.nix { - inherit holochain dna craneLib workspacePath crateCargoTomlPath; + inherit holochain dna craneLib workspacePath crateCargoToml; }; - dna = { holochain, dnaManifestPath ? null, dnaManifest ? null, zomes }: + dna = { holochain, dnaManifest, zomes }: let system = holochain.devShells.holonix.system; pkgs = import inputs.nixpkgs { inherit system; overlays = [ (import inputs.rust-overlay) ]; }; - finalDnaManifest = if dnaManifestPath == null - then (if dnaManifest == null - then builtins.throw "Either the dnaManifest or the dnaManifestPath need to be set" - else pkgs.writeText "dna.yaml" dnaManifest - ) - else dnaManifestPath; in pkgs.callPackage ./nix/dna.nix { - inherit zomes holochain; - dnaManifest = finalDnaManifest; + inherit zomes holochain dnaManifest; }; - happ = { holochain, happManifest ? null, happManifestPath ? null, dnas }: + happ = { holochain, happManifest, dnas }: let system = holochain.devShells.holonix.system; pkgs = import inputs.nixpkgs { inherit system; overlays = [ (import inputs.rust-overlay) ]; }; - finalHappManifest = if happManifestPath == null - then (if happManifest == null - then builtins.throw "Either the happManifest or the happManifestPath need to be set" - else pkgs.writeText "happ.yaml" happManifest - ) - else happManifestPath; in pkgs.callPackage ./nix/happ.nix { - inherit dnas holochain; - happManifest = finalHappManifest; + inherit dnas holochain happManifest; }; }; }; diff --git a/nix/fixture/dna.nix b/nix/fixture/dna.nix index 331b75f..c6d8804 100644 --- a/nix/fixture/dna.nix +++ b/nix/fixture/dna.nix @@ -21,7 +21,7 @@ in { my_dna = inputs.hcUtils.outputs.lib.dna { - dnaManifestPath = ./dna.yaml; + dnaManifest = ./dna.yaml; inherit zomes; holochain = inputs'.holochain; }; diff --git a/nix/fixture/flake.lock b/nix/fixture/flake.lock index cf6e30f..92d36fc 100644 --- a/nix/fixture/flake.lock +++ b/nix/fixture/flake.lock @@ -540,7 +540,7 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-Zlbt1e1r4wWPnBzUxxDsxi4D0ALi0RmCCi3AUFBwEfk=", + "narHash": "sha256-5o6y2S7AbOlr0aMfN28qT2gYcfS5Y+OxUcga3+3UyYQ=", "path": "../..", "type": "path" }, diff --git a/nix/fixture/happ.nix b/nix/fixture/happ.nix index 298897c..3a149a7 100644 --- a/nix/fixture/happ.nix +++ b/nix/fixture/happ.nix @@ -15,7 +15,7 @@ }: { packages = let - happManifestPath = ./happ.yaml; + happManifest = ./happ.yaml; allDnas = inputs.hcUtils.lib.filterDnas self'.packages; dnas = { } // allDnas; @@ -23,7 +23,7 @@ { my_happ = inputs.hcUtils.outputs.lib.happ { holochain = inputs'.holochain; - inherit dnas happManifestPath; + inherit dnas happManifest; }; }; }; diff --git a/nix/fixture/zome/zome.nix b/nix/fixture/zome/zome.nix index a56fb0d..3c2a165 100644 --- a/nix/fixture/zome/zome.nix +++ b/nix/fixture/zome/zome.nix @@ -9,7 +9,7 @@ packages.my_zome = inputs.hcUtils.outputs.lib.rustZome { workspacePath = rootPath; holochain = inputs'.holochain; - crateCargoTomlPath = ./Cargo.toml; + crateCargoToml = ./Cargo.toml; }; checks.my_zome = inputs.hcUtils.outputs.lib.sweettest { workspacePath = rootPath; @@ -35,9 +35,8 @@ my_zome = self'.packages.my_zome; }; holochain = inputs'.holochain; - }; - crateCargoTomlPath = ./Cargo.toml; + crateCargoToml = ./Cargo.toml; }; }; } diff --git a/nix/sweettest.nix b/nix/sweettest.nix index 2176f6e..1dbc9b4 100644 --- a/nix/sweettest.nix +++ b/nix/sweettest.nix @@ -5,11 +5,11 @@ pkgs, lib, craneLib, - crateCargoTomlPath, + crateCargoToml, ... }: let - cargoToml = builtins.fromTOML (builtins.readFile crateCargoTomlPath); + cargoToml = builtins.fromTOML (builtins.readFile crateCargoToml); crate = cargoToml.package.name; buildInputs = (with pkgs; [ openssl holochain.packages.opensslStatic sqlcipher ]) diff --git a/nix/zome.nix b/nix/zome.nix index ade5035..d3fe013 100644 --- a/nix/zome.nix +++ b/nix/zome.nix @@ -4,14 +4,14 @@ binaryen, craneLib, workspacePath, - crateCargoTomlPath, + crateCargoToml, excludedCrates }: let cargoExtraArgs = "--workspace ${if excludedCrates != null then builtins.concatStringsSep " " (builtins.map (excludedCrate: ''--exclude ${excludedCrate}'') excludedCrates) else ''''}"; - cargoToml = builtins.fromTOML (builtins.readFile crateCargoTomlPath); + cargoToml = builtins.fromTOML (builtins.readFile crateCargoToml); crate = cargoToml.package.name; commonArgs = { @@ -27,7 +27,7 @@ let version = "workspace"; }); wasm = craneLib.buildPackage (commonArgs // { - cargoToml = crateCargoTomlPath; + cargoToml = crateCargoToml; cargoLock = workspacePath + /Cargo.lock; cargoArtifacts = wasmDeps; cargoExtraArgs = "-p ${crate} --locked";