Merge pull request 'docs: fix contributing.md' (#5371) from docs-simplify into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5371
This commit is contained in:
hsjobeki
2025-10-03 18:54:36 +00:00
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
**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**:
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**:
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,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"
```
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:
- Add a new remote called upstream
```bash
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:
```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
```
- To make this automatic install the git hooks
```bash
./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)
- **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 <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.
# Standards
## Standards
- Every new module name 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
- 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