Compare commits
1 Commits
bead/nixos
...
c057becb59
| Author | SHA1 | Date | |
|---|---|---|---|
| c057becb59 |
@@ -9,7 +9,7 @@ Directory Structure:
|
|||||||
----------------------
|
----------------------
|
||||||
• packages/ - Custom Nix packages leveraged across various configurations.
|
• packages/ - Custom Nix packages leveraged across various configurations.
|
||||||
• roles/ - Role-based configurations (e.g., kodi, bluetooth) each with its own module (default.nix) for inclusion in machine setups.
|
• roles/ - Role-based configurations (e.g., kodi, bluetooth) each with its own module (default.nix) for inclusion in machine setups.
|
||||||
• machines/ - Machine-specific configurations (e.g., nix-book, z790prors, boxy, wixos) including configuration.nix and hardware-configuration.nix tailored for each hardware.
|
• machines/ - Machine-specific configurations (e.g., nix-book, zix790prors, boxy) including configuration.nix and hardware-configuration.nix tailored for each hardware.
|
||||||
• home/ - Home-manager configurations for personal environments and application settings (e.g., home-nix-book.nix, home-z790prors.nix).
|
• home/ - Home-manager configurations for personal environments and application settings (e.g., home-nix-book.nix, home-z790prors.nix).
|
||||||
|
|
||||||
Design Principles:
|
Design Principles:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ This is a NixOS configuration repository using flakes, managing multiple machine
|
|||||||
|
|
||||||
### Flake Structure
|
### Flake Structure
|
||||||
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
||||||
- **Machines**: `nix-book`, `boxy`, `wixos` (WSL configuration), `zix790prors`, `live-usb`, `johno-macbookpro` (Darwin/macOS)
|
- **Machines**: `nix-book`, `boxy`, `zix790prors`, `live-usb`, `johno-macbookpro` (Darwin/macOS)
|
||||||
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
||||||
|
|
||||||
### Directory Structure
|
### Directory Structure
|
||||||
@@ -74,7 +74,6 @@ The repository also uses a modular home-manager role system for user-space confi
|
|||||||
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
||||||
- **boxy**: Living room media center → optimized for media consumption, excludes sync/office (shared machine)
|
- **boxy**: Living room media center → optimized for media consumption, excludes sync/office (shared machine)
|
||||||
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
||||||
- **wixos**: WSL2 development → full desktop experience, inherits from zix790prors Windows host
|
|
||||||
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
||||||
- **johno-macbookpro**: macOS work laptop → Darwin-specific configuration with development tools
|
- **johno-macbookpro**: macOS work laptop → Darwin-specific configuration with development tools
|
||||||
|
|
||||||
@@ -107,7 +106,6 @@ darwin-rebuild build --flake .#johno-macbookpro
|
|||||||
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
||||||
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
||||||
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
||||||
- `wixos`: WSL2 development environment running in Windows partition of zix790prors, uses `home/home-desktop.nix`
|
|
||||||
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
||||||
- `johno-macbookpro`: macOS work laptop, uses `home/home-darwin-work.nix`
|
- `johno-macbookpro`: macOS work laptop, uses `home/home-darwin-work.nix`
|
||||||
|
|
||||||
|
|||||||
67
flake.lock
generated
67
flake.lock
generated
@@ -60,22 +60,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1765121682,
|
|
||||||
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
@@ -241,38 +225,18 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixos-wsl": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1765841014,
|
|
||||||
"narHash": "sha256-55V0AJ36V5Egh4kMhWtDh117eE3GOjwq5LhwxDn9eHg=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "NixOS-WSL",
|
|
||||||
"rev": "be4af8042e7a61fa12fda58fe9a3b3babdefe17b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "main",
|
|
||||||
"repo": "NixOS-WSL",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765472234,
|
"lastModified": 1767480499,
|
||||||
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
|
"narHash": "sha256-8IQQUorUGiSmFaPnLSo2+T+rjHtiNWc+OAzeHck7N48=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
|
"rev": "30a3c519afcf3f99e2c6df3b359aec5692054d92",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-25.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -293,22 +257,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1767480499,
|
|
||||||
"narHash": "sha256-8IQQUorUGiSmFaPnLSo2+T+rjHtiNWc+OAzeHck7N48=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "30a3c519afcf3f99e2c6df3b359aec5692054d92",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-25.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plasma-manager": {
|
"plasma-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": [
|
"home-manager": [
|
||||||
@@ -364,8 +312,7 @@
|
|||||||
"jovian": "jovian",
|
"jovian": "jovian",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
|
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
|
||||||
"nixos-wsl": "nixos-wsl",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs": "nixpkgs_2",
|
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"plasma-manager": "plasma-manager",
|
"plasma-manager": "plasma-manager",
|
||||||
"plasma-manager-unstable": "plasma-manager-unstable"
|
"plasma-manager-unstable": "plasma-manager-unstable"
|
||||||
|
|||||||
18
flake.nix
18
flake.nix
@@ -4,8 +4,7 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
|
||||||
|
|
||||||
nix-darwin = {
|
nix-darwin = {
|
||||||
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
|
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -55,7 +54,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-wsl, ... } @ inputs: let
|
outputs = { self, nixpkgs, nixpkgs-unstable, ... } @ inputs: let
|
||||||
nixosModules = [
|
nixosModules = [
|
||||||
./roles
|
./roles
|
||||||
] ++ [
|
] ++ [
|
||||||
@@ -176,19 +175,6 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.wixos = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = nixosModules ++ [
|
|
||||||
nixos-wsl.nixosModules.default
|
|
||||||
./machines/wixos/configuration.nix
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.users.johno = import ./home/home-desktop.nix;
|
|
||||||
home-manager.extraSpecialArgs = { inherit system; };
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.zix790prors = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.zix790prors = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = nixosModules ++ [
|
modules = nixosModules ++ [
|
||||||
|
|||||||
@@ -1,244 +0,0 @@
|
|||||||
---
|
|
||||||
description: Manage and respond to Gitea/Forgejo PR review comments
|
|
||||||
---
|
|
||||||
|
|
||||||
# Gitea PR Review Comments
|
|
||||||
|
|
||||||
This skill enables reading PR review comments and posting inline thread replies on Gitea/Forgejo instances.
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
- `tea` CLI configured with a Gitea/Forgejo instance
|
|
||||||
- Access token from tea config: `~/.config/tea/config.yml`
|
|
||||||
- Repository must be a Gitea/Forgejo remote (not GitHub)
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Get the Gitea instance URL and token from tea config:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Get the default login URL and token
|
|
||||||
yq -r '.logins[] | select(.name == "default") | .url' ~/.config/tea/config.yml
|
|
||||||
yq -r '.logins[] | select(.name == "default") | .token' ~/.config/tea/config.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
Or if you have a specific login name:
|
|
||||||
```bash
|
|
||||||
yq -r '.logins[] | select(.name == "YOUR_LOGIN") | .url' ~/.config/tea/config.yml
|
|
||||||
yq -r '.logins[] | select(.name == "YOUR_LOGIN") | .token' ~/.config/tea/config.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
### 1. List PR Review Comments
|
|
||||||
|
|
||||||
Fetch all reviews and their comments for a PR:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Set environment variables
|
|
||||||
GITEA_URL="https://git.johnogle.info"
|
|
||||||
TOKEN="<your-token>"
|
|
||||||
OWNER="<repo-owner>"
|
|
||||||
REPO="<repo-name>"
|
|
||||||
PR_NUMBER="<pr-number>"
|
|
||||||
|
|
||||||
# Get all reviews for the PR
|
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews" | jq
|
|
||||||
|
|
||||||
# Get comments for a specific review
|
|
||||||
REVIEW_ID="<review-id>"
|
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments" | jq
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. View All Review Comments (Combined)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Get all reviews and their comments in one view
|
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews" | \
|
|
||||||
jq -r '.[] | "Review \(.id) by \(.user.login): \(.state)\n Body: \(.body)"'
|
|
||||||
|
|
||||||
# For each review, show inline comments
|
|
||||||
for REVIEW_ID in $(curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews" | jq -r '.[].id'); do
|
|
||||||
echo "=== Review $REVIEW_ID comments ==="
|
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments" | \
|
|
||||||
jq -r '.[] | "[\(.path):\(.line)] \(.body)"'
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Reply to Review Comments (Web Endpoint Method)
|
|
||||||
|
|
||||||
The Gitea REST API does not support replying to review comment threads. The web UI uses a different endpoint:
|
|
||||||
|
|
||||||
```
|
|
||||||
POST /{owner}/{repo}/pulls/{pr_number}/files/reviews/comments
|
|
||||||
Content-Type: multipart/form-data
|
|
||||||
```
|
|
||||||
|
|
||||||
**Required form fields:**
|
|
||||||
- `reply`: Review ID to reply to
|
|
||||||
- `content`: The reply message
|
|
||||||
- `path`: File path
|
|
||||||
- `line`: Line number
|
|
||||||
- `side`: `proposed` or `original`
|
|
||||||
- `single_review`: `true`
|
|
||||||
- `origin`: `timeline`
|
|
||||||
- `_csrf`: CSRF token (required for web endpoint)
|
|
||||||
|
|
||||||
**Authentication Challenge:**
|
|
||||||
This endpoint requires session-based authentication, not API tokens. Options:
|
|
||||||
|
|
||||||
#### Option A: Use Browser Session (Recommended)
|
|
||||||
|
|
||||||
1. Log in to Gitea in your browser
|
|
||||||
2. Open browser developer tools and copy cookies
|
|
||||||
3. Use the session cookies with curl
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# First, get CSRF token from the PR page
|
|
||||||
CSRF=$(curl -s -c cookies.txt -b cookies.txt \
|
|
||||||
"$GITEA_URL/$OWNER/$REPO/pulls/$PR_NUMBER/files" | \
|
|
||||||
grep -oP 'name="_csrf" value="\K[^"]+')
|
|
||||||
|
|
||||||
# Post the reply
|
|
||||||
curl -s -b cookies.txt \
|
|
||||||
-F "reply=$REVIEW_ID" \
|
|
||||||
-F "content=Your reply message here" \
|
|
||||||
-F "path=$FILE_PATH" \
|
|
||||||
-F "line=$LINE_NUMBER" \
|
|
||||||
-F "side=proposed" \
|
|
||||||
-F "single_review=true" \
|
|
||||||
-F "origin=timeline" \
|
|
||||||
-F "_csrf=$CSRF" \
|
|
||||||
"$GITEA_URL/$OWNER/$REPO/pulls/$PR_NUMBER/files/reviews/comments"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Option B: Create Top-Level Comment (Fallback)
|
|
||||||
|
|
||||||
If thread replies are not critical, use the API to create a top-level comment:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Create a top-level comment mentioning the review context
|
|
||||||
curl -s -X POST \
|
|
||||||
-H "Authorization: token $TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"body\": \"Re: @reviewer's comment on $FILE_PATH:$LINE_NUMBER\n\nYour reply here\"}" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/issues/$PR_NUMBER/comments"
|
|
||||||
```
|
|
||||||
|
|
||||||
Or use tea CLI:
|
|
||||||
```bash
|
|
||||||
tea comment $PR_NUMBER "Re: @reviewer's comment on $FILE_PATH:$LINE_NUMBER
|
|
||||||
|
|
||||||
Your reply here"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Submit a New Review
|
|
||||||
|
|
||||||
Create a new review with inline comments:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -s -X POST \
|
|
||||||
-H "Authorization: token $TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{
|
|
||||||
"body": "Overall review comments",
|
|
||||||
"event": "COMMENT",
|
|
||||||
"comments": [
|
|
||||||
{
|
|
||||||
"path": "path/to/file.py",
|
|
||||||
"body": "Comment on this line",
|
|
||||||
"new_position": 10
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}' \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews"
|
|
||||||
```
|
|
||||||
|
|
||||||
Event types: `COMMENT`, `APPROVE`, `REQUEST_CHANGES`
|
|
||||||
|
|
||||||
## Workflow Example
|
|
||||||
|
|
||||||
### Reading and Responding to Reviews
|
|
||||||
|
|
||||||
1. **Set up environment**:
|
|
||||||
```bash
|
|
||||||
export GITEA_URL=$(yq -r '.logins[] | select(.name == "default") | .url' ~/.config/tea/config.yml)
|
|
||||||
export TOKEN=$(yq -r '.logins[] | select(.name == "default") | .token' ~/.config/tea/config.yml)
|
|
||||||
export OWNER="johno"
|
|
||||||
export REPO="nixos-configs"
|
|
||||||
export PR_NUMBER="5"
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **List all pending review comments**:
|
|
||||||
```bash
|
|
||||||
# Get reviews
|
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews" | \
|
|
||||||
jq -r '.[] | select(.state == "REQUEST_CHANGES" or .state == "COMMENT") |
|
|
||||||
"Review \(.id) by \(.user.login) (\(.state)):\n\(.body)\n"'
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Get detailed comments for a review**:
|
|
||||||
```bash
|
|
||||||
REVIEW_ID="2"
|
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments" | \
|
|
||||||
jq -r '.[] | "File: \(.path):\(.line)\nComment: \(.body)\nID: \(.id)\n---"'
|
|
||||||
```
|
|
||||||
|
|
||||||
4. **Respond using top-level comment** (most reliable):
|
|
||||||
```bash
|
|
||||||
tea comment $PR_NUMBER "Addressing review feedback:
|
|
||||||
|
|
||||||
- File \`path/to/file.py\` line 10: Fixed the issue by...
|
|
||||||
- File \`other/file.py\` line 25: Updated as suggested..."
|
|
||||||
```
|
|
||||||
|
|
||||||
## API Reference
|
|
||||||
|
|
||||||
### Endpoints
|
|
||||||
|
|
||||||
| Action | Method | Endpoint |
|
|
||||||
|--------|--------|----------|
|
|
||||||
| List reviews | GET | `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews` |
|
|
||||||
| Get review | GET | `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews/{id}` |
|
|
||||||
| Get review comments | GET | `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments` |
|
|
||||||
| Create review | POST | `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews` |
|
|
||||||
| Submit review | POST | `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews/{id}` |
|
|
||||||
| Delete review | DELETE | `/api/v1/repos/{owner}/{repo}/pulls/{index}/reviews/{id}` |
|
|
||||||
| Create issue comment | POST | `/api/v1/repos/{owner}/{repo}/issues/{index}/comments` |
|
|
||||||
|
|
||||||
### Review States
|
|
||||||
|
|
||||||
- `PENDING` - Draft review not yet submitted
|
|
||||||
- `COMMENT` - General comment without approval/rejection
|
|
||||||
- `APPROVE` - Approving the changes
|
|
||||||
- `REQUEST_CHANGES` - Requesting changes before merge
|
|
||||||
|
|
||||||
## Limitations
|
|
||||||
|
|
||||||
1. **Thread replies**: The Gitea REST API does not support replying directly to review comment threads. This is a known limitation. Workarounds:
|
|
||||||
- Use top-level comments with context
|
|
||||||
- Use the web UI manually for thread replies
|
|
||||||
- Implement session-based authentication to use the web endpoint
|
|
||||||
|
|
||||||
2. **CSRF tokens**: The web endpoint for thread replies requires CSRF tokens, which expire and need to be fetched from the page.
|
|
||||||
|
|
||||||
3. **Session auth**: API tokens work for REST API but not for web endpoints that require session cookies.
|
|
||||||
|
|
||||||
## Tips
|
|
||||||
|
|
||||||
- Always quote file paths and line numbers when responding via top-level comments
|
|
||||||
- Use `tea pr view $PR_NUMBER --comments` to see all comments
|
|
||||||
- Use `tea open pulls/$PR_NUMBER` to open the PR in browser for manual thread replies
|
|
||||||
- Consider using `tea pr approve $PR_NUMBER` after addressing all comments
|
|
||||||
|
|
||||||
## See Also
|
|
||||||
|
|
||||||
- Gitea API Documentation: https://docs.gitea.com/api/1.20/
|
|
||||||
- `tea` CLI: https://gitea.com/gitea/tea
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
|
||||||
|
|
||||||
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
|
|
||||||
# https://github.com/nix-community/NixOS-WSL
|
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
];
|
|
||||||
|
|
||||||
roles = {
|
|
||||||
audio.enable = true;
|
|
||||||
desktop = {
|
|
||||||
enable = true;
|
|
||||||
wayland = true;
|
|
||||||
};
|
|
||||||
users.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.hostName = "wixos";
|
|
||||||
|
|
||||||
wsl.enable = true;
|
|
||||||
wsl.defaultUser = "johno";
|
|
||||||
wsl.startMenuLaunchers = true;
|
|
||||||
wsl.useWindowsDriver = true;
|
|
||||||
wsl.wslConf.network.hostname = "wixos";
|
|
||||||
wsl.wslConf.user.default = "johno";
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
|
||||||
hardware.graphics = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
mesa
|
|
||||||
libvdpau-va-gl
|
|
||||||
libva-vdpau-driver
|
|
||||||
];
|
|
||||||
};
|
|
||||||
environment.sessionVariables = {
|
|
||||||
LD_LIBRARY_PATH = [
|
|
||||||
"/usr/lib/wsl/lib"
|
|
||||||
"/run/opengl-driver/lib"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
hardware.nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
open = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
|
||||||
};
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user