diff --git a/src/cli/custom-template/README.md b/src/cli/custom-template/README.md index f1026523..450e18d9 100644 --- a/src/cli/custom-template/README.md +++ b/src/cli/custom-template/README.md @@ -6,24 +6,20 @@ Custom template for the [scaffolding tool](https://github.com/holochain/scaffold 1. To scaffold a new project with this template, run this: -`nix run github:#hc-scaffold-custom-template -- web-app` +`nix run github:#app -- web-app` -2. If you already have an existing project, add the `` repository as input to your flake, and use it in the packages or your `devShell`: +2. If you already have an existing project, add the `` repository as input to your flake, and use it in the packages or your `devShell`: ```diff { - description = "Template for Holochain app development"; + description = "Flake for Holochain app development"; inputs = { - versions.url = "github:holochain/holochain?dir=versions/weekly"; + holonix.url = "github:holochain/holonix?ref=main"; + nixpkgs.follows = "holonix/nixpkgs"; + flake-parts.follows = "holonix/flake-parts"; - holochain-flake.url = "github:holochain/holochain"; - holochain-flake.inputs.versions.follows = "versions"; - - nixpkgs.follows = "holochain-flake/nixpkgs"; - flake-parts.follows = "holochain-flake/flake-parts"; - -+ scaffolding.url = "github:"; ++ scaffolding.url = "github:"; }; outputs = inputs: @@ -32,7 +28,7 @@ Custom template for the [scaffolding tool](https://github.com/holochain/scaffold inherit inputs; } { - systems = builtins.attrNames inputs.holochain-flake.devShells; + systems = builtins.attrNames inputs.holonix.devShells; perSystem = { inputs' , config @@ -41,17 +37,17 @@ Custom template for the [scaffolding tool](https://github.com/holochain/scaffold , ... }: { devShells.default = pkgs.mkShell { - inputsFrom = [ inputs'.holochain-flake.devShells.holonix ]; + inputsFrom = [ inputs'.holonix.devShells.default ]; packages = [ pkgs.nodejs_20 # more packages go here + ] ++ [ -+ inputs'.scaffolding.packages.hc-scaffold-custom-template ++ inputs'.scaffolding.packages.app ]; }; }; }; -} +} ``` --- @@ -72,4 +68,4 @@ To run the tests for this custom template, simply run the `run_test.sh` script: ```bash sh run_test.sh -``` +``` diff --git a/src/lib.rs b/src/lib.rs index a4cd6e8a..5ef6a0a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,10 +97,19 @@ //! To create a custom template, execute these steps: //! //! 1. Run this command: -//! `nix flake init -t github:holochain/scaffolding` -//! 2. A new dir `custom-template` will be created in the current directory. Check this new folder in a version control system like git. -//! 3. Replace all instances of `` in its `README.md` file with the appropriate git URL (eg. "github:holochain-open-dev/templates"). -//! 4. Replace all instances of `` in its `template/web-app/flake.nix.hbs` file with the appropriate git URL (eg. "github:holochain-open-dev/templates"). +//! - Through holonix: +//! +//! ```bash +//! nix run github:holochain/holonix#hc-scaffold -- template new +//! ``` +//! - Outside holonix if the cli was installed via `cargo install holochain_scaffolding_cli` +//! +//! ```bash +//! hc-scaffold template new +//! ``` +//! 2. A new dir will be created in the current directory. Check this new folder in a version control system like git. +//! 3. Replace all instances of `` in its `README.md` file with the appropriate git URL (eg. "github:holochain-open-dev/templates"). +//! 4. Replace all instances of `` in its `template/web-app/flake.nix.hbs` file with the appropriate git URL (eg. "github:holochain-open-dev/templates"). //! //! That's it! At this point you will have a correctly functioning custom template repository with tests, a `README.md` documenting how to use it, and a `template` folder. That's where your custom template lives. //!