docs: fix contributing.md

This commit is contained in:
Johannes Kirschbauer
2025-10-03 20:51:04 +02:00
parent 3fc2a55468
commit f9c58b4912
3 changed files with 43 additions and 37 deletions

View File

@@ -1,4 +0,0 @@
# Contributing to Clan
<!-- Local file: docs/CONTRIBUTING.md -->
Go to the Contributing guide at https://docs.clan.lol/guides/contributing/CONTRIBUTING

View File

@@ -1,6 +1,5 @@
# Contributing to Clan # 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. **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. **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 - Linux
- macOS - macOS
# Getting Started with the Development Environment ## Getting Started with the Development Environment
Let's get your development environment up and running: Let's get your development environment up and running:
1. **Install Nix Package Manager**: 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: - 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 ```bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
``` ```
1. **Install direnv**: 2. **Install direnv**:
- To automatically setup a devshell on entering the directory - To automatically setup a devshell on entering the directory
```bash ```bash
nix profile install nixpkgs#nix-direnv-flakes nixpkgs#direnv nix profile install nixpkgs#nix-direnv-flakes nixpkgs#direnv
``` ```
1. **Add direnv to your shell**: 3. **Add direnv to your shell**:
- Direnv needs to [hook into your shell](https://direnv.net/docs/hook.html) to work. - 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` You can do this by executing following command. The example below will setup direnv for `zsh` and `bash`
@@ -37,31 +38,40 @@ Let's get your development environment up and running:
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && eval "$SHELL" 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 - 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 - Register an account on https://git.clan.lol
- Fork the [clan-core](https://git.clan.lol/clan/clan-core) repository - Fork the [clan-core](https://git.clan.lol/clan/clan-core) repository
- Clone the repository and navigate to it - Clone the repository and navigate to it
- Add a new remote called upstream: - Add a new remote called upstream
```bash ```bash
git remote add upstream gitea@git.clan.lol:clan/clan-core.git git remote add upstream gitea@git.clan.lol:clan/clan-core.git
``` ```
1. **Allow .envrc**:
7. **Allow .envrc**
- When you enter the directory, you'll receive an error message like this: - When you enter the directory, you'll receive an error message like this:
```bash ```bash
direnv: error .envrc is blocked. Run `direnv allow` to approve its content 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. - 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: - To syntax check your code you can run:
```bash ```bash
nix fmt nix fmt
``` ```
- To make this automatic install the git hooks - To make this automatic install the git hooks
```bash ```bash
./scripts/pre-commit ./scripts/pre-commit
``` ```
@@ -73,7 +83,7 @@ Let's get your development environment up and running:
- **Nixos Anywhere**: [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) - **Nixos Anywhere**: [nixos-anywhere](https://github.com/nix-community/nixos-anywhere)
- **Disko**: [disko](https://github.com/nix-community/disko) - **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. 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 <path_to_local_src> 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 `<path_to_local_src>` 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. And thus can point to test already opened PRs for example.
# Standards ## Standards
- Every new module name should be in kebab-case. - Every new module name should be in kebab-case.
- Every fact definition, where possible should be in kebab-case. - Every fact definition, where possible should be in kebab-case.

View File

@@ -99,9 +99,9 @@ nav:
- Disk Encryption: guides/disk-encryption.md - Disk Encryption: guides/disk-encryption.md
- Disable Secure Boot: guides/secure-boot.md - Disable Secure Boot: guides/secure-boot.md
- Contributing: - Contributing:
- Hacking: guides/contributing/CONTRIBUTING.md - guides/contributing/CONTRIBUTING.md
- Advanced Debugging: guides/contributing/debugging.md - guides/contributing/debugging.md
- Testing: guides/contributing/testing.md - guides/contributing/testing.md
- Reference: - Reference:
- Overview: reference/index.md - Overview: reference/index.md