| .forgejo/workflows | ||
| .fast-commit.toml | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| license.txt | ||
| README.md | ||
Nix Runner for Gitea Actions
This repository provides a Nix-based Docker image for use with Gitea Actions, allowing you to run CI/CD pipelines using Nix instead of pre-installed software.
Guide from: https://icewind.nl/entry/gitea-actions-nix/
Building the Image
-
Clone this repository:
git clone <your-repo-url> cd nix-runner -
Build the Docker image:
nix build .#runner -
Load the image into Docker:
docker load -i result -
Tag and push to your container registry:
docker tag nix-runner:latest your-registry/nix-runner:latest docker push your-registry/nix-runner:latest
Configuring Gitea Runner
Configure your Gitea Actions runner to use the Nix image. Example NixOS configuration:
services.gitea-actions-runner.instances.nix-runner = {
enable = true;
name = "nix-runner";
url = "https://your-gitea-instance.com";
tokenFile = "/path/to/your/secret";
labels = [
"nix:docker://your-registry/nix-runner"
];
};
Using in Workflows
Create a .gitea/workflows directory in your repository and add a workflow file like the one in this repo.
The workflow will run on the Nix image, allowing you to use nix build, nix develop, and other Nix commands.
Customization
You can customize the image by modifying flake.nix:
- Add more packages to
extraPkgs - Configure additional binary caches in
nixConf.substituters - Update Nix version or Nixpkgs channel
License
This project is licensed under the MIT License - see the license.txt file for details.