diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index acb9754..a13fd90 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,28 @@ Install the dependencies using npm: npm i ``` +### Nix Setup (With Flakes) + +Pull down this project locally. + +when you enter the directory if you have direnv installed run: + +```sh +direnv allow +``` + +If you do not run + +```sh +nix develop +``` + +this will pull down all dependencies, install hooks and formatters etc. You are now free to run. + +```sh +npm i +``` + ## Building the project Run the `build` script: diff --git a/README.md b/README.md index bd96989..77b827d 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,38 @@ This will create a `.ai-shell` file in your home directory. +### Nix Setup (With Flakes) + +This package can be integrated into Nix environments as a custom package. Follow the steps below to set it up: + +1. **Add this package to your flakes inputs:** + ```nix + inputs.ai-shell.url = "github:BuilderIO/ai-shell"; + ``` + +2. **Add the package to your system or Home Manager configuration:** + - For Home Manager: + ```nix + home.packages = with pkgs; [ + inputs.ai-shell.defaultPackage.x86_64-linux + ]; + ``` + - **or** for NixOS system packages: + ```nix + users.users..packages = with pkgs; [ + inputs.ai-shell.defaultPackage.x86_64-linux + ]; + ``` + +3. **Activate the configuration:** + If you are on NixOS, execute: + ```bash + sudo nixos-rebuild switch --flake .#your-computer + ``` + +And you are good to go! + + ## Usage ```bash