diff --git a/crates/scaffold_remote_zome/default.nix b/crates/scaffold_remote_zome/default.nix new file mode 100644 index 0000000..fa83ce4 --- /dev/null +++ b/crates/scaffold_remote_zome/default.nix @@ -0,0 +1,33 @@ +{ inputs, self, ... }: + +{ + perSystem = { inputs', pkgs, self', lib, ... }: { + + packages.scaffold-remote-zome = let + craneLib = inputs.crane.mkLib pkgs; + + cratePath = ./.; + + cargoToml = + builtins.fromTOML (builtins.readFile "${cratePath}/Cargo.toml"); + crate = cargoToml.package.name; + + commonArgs = { + src = craneLib.cleanCargoSource (craneLib.path ../../.); + doCheck = false; + buildInputs = + self.lib.holochainAppDeps.buildInputs { inherit pkgs lib; }; + nativeBuildInputs = + self.lib.holochainAppDeps.nativeBuildInputs { inherit pkgs lib; }; + }; + cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { + pname = "workspace"; + version = "workspace"; + }); + in craneLib.buildPackage (commonArgs // { + pname = crate; + version = cargoToml.package.version; + inherit cargoArtifacts; + }); + }; +} diff --git a/flake.nix b/flake.nix index f9e3294..7e638a1 100644 --- a/flake.nix +++ b/flake.nix @@ -196,9 +196,11 @@ }; }; + imports = [ ./crates/scaffold_remote_zome/default.nix ]; + systems = builtins.attrNames inputs.holochain.devShells; - perSystem = { inputs', config, pkgs, system, lib, ... }: rec { + perSystem = { inputs', config, pkgs, system, lib, ... }: rec { devShells.default = pkgs.mkShell { inputsFrom = [ inputs'.holochain.devShells.holonix ]; packages = with pkgs; @@ -312,34 +314,6 @@ inherit cargoArtifacts; }); - packages.scaffold-remote-zome = let - craneLib = inputs.crane.mkLib pkgs; - - cratePath = ./crates/scaffold_remote_zome; - - cargoToml = - builtins.fromTOML (builtins.readFile "${cratePath}/Cargo.toml"); - crate = cargoToml.package.name; - - commonArgs = { - src = craneLib.cleanCargoSource (craneLib.path ./.); - doCheck = false; - buildInputs = - flake.lib.holochainAppDeps.buildInputs { inherit pkgs lib; }; - nativeBuildInputs = flake.lib.holochainAppDeps.nativeBuildInputs { - inherit pkgs lib; - }; - }; - cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { - pname = "workspace"; - version = "workspace"; - }); - in craneLib.buildPackage (commonArgs // { - pname = crate; - version = cargoToml.package.version; - inherit cargoArtifacts; - }); - packages.pnpm = pkgs.writeShellScriptBin "pnpm" '' #!${pkgs.bash}/bin/bash exec ${pkgs.nodejs_20}/bin/node ${pkgs.nodejs_20}/bin/corepack pnpm@9.2.0 "$@"