A Nix-based Docker image for use with Gitea Actions, allowing you to run CI/CD pipelines using Nix instead of pre-installed software.
Find a file
2025-11-09 20:31:31 +01:00
.forgejo/workflows fix(ci): update build workflow to use forgejo context variables instead of gitea 2025-11-09 20:31:31 +01:00
.fast-commit.toml chore: add fast-commit config and update license holder to 2025 ferrumboll 2025-11-09 20:29:55 +01:00
.gitignore feat: add default package 2025-11-09 11:32:49 +01:00
flake.lock feat: add default package 2025-11-09 11:32:49 +01:00
flake.nix feat: add default package 2025-11-09 11:32:49 +01:00
license.txt chore: add fast-commit config and update license holder to 2025 ferrumboll 2025-11-09 20:29:55 +01:00
README.md feat: add default package 2025-11-09 11:32:49 +01:00

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

  1. Clone this repository:

    git clone <your-repo-url>
    cd nix-runner
    
  2. Build the Docker image:

    nix build .#runner
    
  3. Load the image into Docker:

    docker load -i result
    
  4. 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.