From f9c58b4912aa66598d2cbfd9783cfdd8a75faa78 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 3 Oct 2025 20:51:04 +0200 Subject: [PATCH] docs: fix contributing.md --- CONTRIBUTING.md | 4 --- docs/CONTRIBUTING.md | 70 +++++++++++++++++++++++++------------------- docs/mkdocs.yml | 6 ++-- 3 files changed, 43 insertions(+), 37 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 76f3acb60..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -# Contributing to Clan - - -Go to the Contributing guide at https://docs.clan.lol/guides/contributing/CONTRIBUTING \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 09cfc3f66..0c279ed04 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,6 +1,5 @@ # Contributing to Clan - **Continuous Integration (CI)**: Each pull request gets automatically tested by gitea. If any errors are detected, it will block pull requests until they're resolved. **Dependency Management**: We use the [Nix package manager](https://nixos.org/) to manage dependencies and ensure reproducibility, making your development process more robust. @@ -10,25 +9,27 @@ - Linux - macOS -# Getting Started with the Development Environment +## Getting Started with the Development Environment Let's get your development environment up and running: 1. **Install Nix Package Manager**: - You can install the Nix package manager by either [downloading the Nix installer](https://github.com/DeterminateSystems/nix-installer/releases) or running this command: - ```bash - curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install - ``` -1. **Install direnv**: + ```bash + curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install + ``` + +2. **Install direnv**: - To automatically setup a devshell on entering the directory - ```bash - nix profile install nixpkgs#nix-direnv-flakes nixpkgs#direnv - ``` -1. **Add direnv to your shell**: + ```bash + nix profile install nixpkgs#nix-direnv-flakes nixpkgs#direnv + ``` + +3. **Add direnv to your shell**: - Direnv needs to [hook into your shell](https://direnv.net/docs/hook.html) to work. You can do this by executing following command. The example below will setup direnv for `zsh` and `bash` @@ -37,34 +38,43 @@ Let's get your development environment up and running: echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && eval "$SHELL" ``` -1. **Allow the devshell** +4. **Allow the devshell** - Go to `clan-core/pkgs/clan-cli` and do a `direnv allow` to setup the necessary development environment to execute the `clan` command -1. **Create a Gitea Account**: +5. **Create a Gitea Account** + - Register an account on https://git.clan.lol - Fork the [clan-core](https://git.clan.lol/clan/clan-core) repository - Clone the repository and navigate to it - - Add a new remote called upstream: - ```bash - git remote add upstream gitea@git.clan.lol:clan/clan-core.git - ``` -1. **Allow .envrc**: + - Add a new remote called upstream + + ```bash + git remote add upstream gitea@git.clan.lol:clan/clan-core.git + ``` + +7. **Allow .envrc** - When you enter the directory, you'll receive an error message like this: - ```bash - direnv: error .envrc is blocked. Run `direnv allow` to approve its content - ``` + + ```bash + direnv: error .envrc is blocked. Run `direnv allow` to approve its content + ``` + - Execute `direnv allow` to automatically execute the shell script `.envrc` when entering the directory. -1. **(Optional) Install Git Hooks**: +8. **(Optional) Install Git Hooks** + - To syntax check your code you can run: - ```bash - nix fmt - ``` + + ```bash + nix fmt + ``` + - To make this automatic install the git hooks - ```bash - ./scripts/pre-commit - ``` + + ```bash + ./scripts/pre-commit + ``` ## Related Projects @@ -73,7 +83,7 @@ Let's get your development environment up and running: - **Nixos Anywhere**: [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) - **Disko**: [disko](https://github.com/nix-community/disko) -## Fixing Bugs or Adding Features in Clan-CLI +### Override related projects for local development If you have a bug fix or feature that involves a related project, clone the relevant repository and replace its invocation in your local setup. @@ -102,10 +112,10 @@ run( ``` -The doesn't need to be a local path, it can be any valid [flakeref](https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-flake.html#flake-references). +The `` doesn't need to be a local path, it can be any valid [flakeref](https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-flake.html#flake-references). And thus can point to test already opened PRs for example. -# Standards +## Standards - Every new module name should be in kebab-case. - Every fact definition, where possible should be in kebab-case. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index d68a57c4c..59a28c8b3 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -99,9 +99,9 @@ nav: - Disk Encryption: guides/disk-encryption.md - Disable Secure Boot: guides/secure-boot.md - Contributing: - - Hacking: guides/contributing/CONTRIBUTING.md - - Advanced Debugging: guides/contributing/debugging.md - - Testing: guides/contributing/testing.md + - guides/contributing/CONTRIBUTING.md + - guides/contributing/debugging.md + - guides/contributing/testing.md - Reference: - Overview: reference/index.md