feat: Migrate CI to gitea

This commit is contained in:
UGA Innovation Factory
2025-12-18 12:35:35 -05:00
committed by Hunter Halloran
parent d205211c7d
commit a23ec91c9c
13 changed files with 167 additions and 175 deletions

View File

@@ -16,7 +16,7 @@ This guide covers building installer ISOs, live images, and container artifacts
```bash
# Build an installer ISO for a specific host
nix build github:UGA-Innovation-Factory/nixos-systems#installer-iso-nix-laptop1
nix build git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#installer-iso-nix-laptop1
# Result will be in result/iso/
ls -lh result/iso/
@@ -27,7 +27,7 @@ ls -lh result/iso/
List all available build outputs:
```bash
nix flake show github:UGA-Innovation-Factory/nixos-systems
nix flake show git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git
```
Common artifact types:
@@ -57,10 +57,10 @@ ls -lh result/iso/nixos-*.iso
sudo dd if=result/iso/nixos-*.iso of=/dev/sdX bs=4M status=progress
```
### Building from GitHub
### Building from Gitea
```bash
nix build github:UGA-Innovation-Factory/nixos-systems#installer-iso-nix-laptop1
nix build git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#installer-iso-nix-laptop1
```
### Using the Installer

View File

@@ -66,7 +66,7 @@ sudo nixos-rebuild build --flake .
## Continuous Integration
The repository uses GitHub Actions for automated testing and validation. CI jobs run on the self-hosted `nix-builder` machine via SSH.
The repository uses Gitea Actions for automated testing and validation. CI jobs run on the self-hosted `nix-builder` machine.
### CI Workflow
@@ -94,7 +94,7 @@ Check the CI status badge at the top of the README or view detailed logs:
```bash
# View workflow status
https://github.com/UGA-Innovation-Factory/nixos-systems/actions
https://git.factory.uga.edu/UGA-Innovation-Factory/athenix/actions
```
### Running CI Checks Locally
@@ -118,49 +118,49 @@ nix build .#lxc-nix-builder
### Self-Hosted Runner
CI jobs run on the `nix-builder` host as a self-hosted GitHub Actions runner. This provides:
CI jobs run on the `nix-builder` host as a self-hosted Gitea Actions runner. This provides:
- Native Nix environment without installation overhead
- Access to local Nix store for faster builds
- Consistent build environment matching deployment targets
- Direct access to build caching infrastructure
#### Setting Up the GitHub Actions Runner
#### Setting Up the Gitea Actions Runner
The nix-builder host is configured with a GitHub Actions self-hosted runner in `inventory.nix`. To complete the setup:
The nix-builder host is configured with a Gitea Actions self-hosted runner in `inventory.nix`. To complete the setup:
1. **Generate a GitHub Personal Access Token (PAT)**:
- Go to https://github.com/settings/tokens
- Create a new token with `repo` scope
- Copy the token value
1. **Generate a Gitea Runner Token**:
- Go to https://git.factory.uga.edu/UGA-Innovation-Factory/athenix/settings/actions/runners
- Click "Create new Runner"
- Copy the registration token
2. **Create the token file on nix-builder**:
```bash
ssh engr-ugaif@nix-builder
echo "YOUR_TOKEN_HERE" | sudo tee /var/lib/github-runner-token > /dev/null
sudo chmod 600 /var/lib/github-runner-token
echo "YOUR_TOKEN_HERE" | sudo tee /var/lib/gitea-runner-token > /dev/null
sudo chmod 600 /var/lib/gitea-runner-token
```
3. **Rebuild the system** to start the runner:
```bash
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems#nix-builder
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#nix-builder
```
4. **Verify the runner is registered**:
- Check https://github.com/UGA-Innovation-Factory/nixos-systems/settings/actions/runners
- Check https://git.factory.uga.edu/UGA-Innovation-Factory/athenix/settings/actions/runners
- The runner should appear with the `nix-builder` label
The runner service is configured in the nix-builder device configuration and will automatically:
- Register with the repository on first start
- Use the `nix-builder` label for workflow targeting
- Run as the `engr-ugaif` user
- Store work in `/var/lib/github-runner`
- Store work in `/var/lib/gitea-runner`
### Troubleshooting CI Failures
If CI fails:
1. **Check the error logs** in the GitHub Actions tab
1. **Check the error logs** in the Gitea Actions tab
2. **Run the same command locally** to reproduce the issue
3. **Use `--show-trace`** for detailed error information
4. **Verify formatting** with `nix fmt` if format check fails
@@ -195,13 +195,13 @@ sudo nixos-rebuild build --flake .
```bash
# Rebuild from GitHub main branch
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git
# Use --impure for external user configurations with fetchGit
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems --impure
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git --impure
# Rebuild specific host from GitHub
sudo nixos-rebuild switch --flake github:UGA-Innovation-Factory/nixos-systems#nix-laptop1
sudo nixos-rebuild switch --flake git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#nix-laptop1
```
### Boot into Previous Generation

View File

@@ -38,7 +38,7 @@ nix-lxc = {
# External module from Git
"remote-server" = builtins.fetchGit {
url = "https://github.com/org/server-config";
url = "https://git.factory.uga.edu/org/server-config";
rev = "abc123..."; # Pin to specific commit
};
};
@@ -96,7 +96,7 @@ Later modules can override earlier ones using standard NixOS module precedence.
Create a new system module:
```bash
nix flake init -t github:UGA-Innovation-Factory/nixos-systems#system
nix flake init -t git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#system
```
See [templates/system/](../templates/system/) for the complete template.
@@ -111,7 +111,7 @@ External user modules provide home-manager configurations (dotfiles, packages, p
athenix.users = {
# External user module (dotfiles, home-manager, and user options)
myuser = builtins.fetchGit {
url = "https://github.com/username/dotfiles";
url = "https://git.factory.uga.edu/username/dotfiles";
rev = "abc123...";
};
@@ -225,7 +225,7 @@ username = {
Create a new user module:
```bash
nix flake init -t github:UGA-Innovation-Factory/nixos-systems#user
nix flake init -t git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#user
```
See [templates/user/](../templates/user/) for the complete template.
@@ -303,7 +303,7 @@ Use local directories during development:
# Initialize in new directory
mkdir my-server-config
cd my-server-config
nix flake init -t github:UGA-Innovation-Factory/nixos-systems#system
nix flake init -t git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#system
```
See [templates/system/README.md](../templates/system/README.md) for detailed usage.
@@ -314,7 +314,7 @@ See [templates/system/README.md](../templates/system/README.md) for detailed usa
# Initialize in new directory
mkdir my-dotfiles
cd my-dotfiles
nix flake init -t github:UGA-Innovation-Factory/nixos-systems#user
nix flake init -t git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#user
```
See [templates/user/README.md](../templates/user/README.md) for detailed usage.
@@ -369,7 +369,7 @@ You can mix external modules with local overrides:
nix-lxc = {
devices = {
"server" = builtins.fetchGit {
url = "https://github.com/org/base-config";
url = "https://git.factory.uga.edu/org/base-config";
rev = "abc123...";
};
};

View File

@@ -115,7 +115,7 @@ For complex configurations, use external modules (see [EXTERNAL_MODULES.md](../E
nix-lxc = {
devices = {
"special-server" = builtins.fetchGit {
url = "https://github.com/org/server-config";
url = "https://git.factory.uga.edu/org/server-config";
rev = "abc123...";
};
};

View File

@@ -216,7 +216,7 @@ athenix.users.myuser = {
# Option 2: Use external configuration (recommended)
# The external user.nix can set athenix.users.myuser options directly
athenix.users.anotheruser.external = builtins.fetchGit {
url = "https://github.com/username/dotfiles";
url = "https://git.factory.uga.edu/username/dotfiles";
rev = "abc123...";
};
```

View File

@@ -40,7 +40,7 @@ athenix.users = {
# Option 2: External configuration (recommended for personalization)
myuser.external = builtins.fetchGit {
url = "https://github.com/username/dotfiles";
url = "https://git.factory.uga.edu/username/dotfiles";
rev = "abc123..."; # Pin to specific commit
};
};
@@ -126,7 +126,7 @@ myuser = {
# Point to external configuration repository
external = builtins.fetchGit {
url = "https://github.com/username/dotfiles";
url = "https://git.factory.uga.edu/username/dotfiles";
rev = "abc123..."; # Pin to specific commit
};
};
@@ -236,7 +236,7 @@ external = /home/username/dev/dotfiles;
### Create User Template
```bash
nix flake init -t github:UGA-Innovation-Factory/nixos-systems#user
nix flake init -t git+https://git.factory.uga.edu/UGA-Innovation-Factory/athenix.git#user
```
See [templates/user/README.md](../templates/user/README.md) for complete template.
@@ -390,7 +390,7 @@ developer = {
shell = pkgs.zsh;
hashedPassword = "$6$...";
external = builtins.fetchGit {
url = "https://github.com/username/dotfiles";
url = "https://git.factory.uga.edu/username/dotfiles";
rev = "abc123def456...";
};
};
@@ -405,7 +405,7 @@ wsl-user = {
shell = pkgs.zsh;
hashedPassword = "$6$...";
external = builtins.fetchGit {
url = "https://github.com/username/dotfiles";
url = "https://git.factory.uga.edu/username/dotfiles";
rev = "abc123...";
};
};
@@ -489,7 +489,7 @@ nix eval .#nixosConfigurations.nix-laptop1.config.users.users.myuser.openssh.aut
**Check repository access:**
```bash
git ls-remote https://github.com/username/dotfiles
git ls-remote https://git.factory.uga.edu/username/dotfiles
```
**Verify structure:**