- github_runner/docker-compose.yml: add x-runner-common/x-runner-env anchors so org runners can be added per-service without duplicating App credentials in .env; default primary runner to RUNNER_SCOPE=repo and APP_LOGIN=kiskaadee - github_runner/.env-example: keep .env scoped to shared App ID, base64 key, labels, and personal repo URL
GitHub Actions Runner (github_runner)
Ephemeral, Nix-enabled self-hosted GitHub Actions runner built on myoung34/github-runner:ubuntu-noble with Nix (nix-command and flakes enabled) and GitHub App authentication.
Architecture
- Host-Mode Execution (No Docker Socket): Canopy forbids mounting
/var/run/docker.sockor running privileged containers. Workflows run directly inside the runner container as the non-rootrunneruser (RUN_AS_ROOT=false). - Ephemeral Lifecycle (
EPHEMERAL=true): After completing a single job, the runner deregisters and exits0; Docker (restart: unless-stopped) restarts the container andentrypoint-nix.shre-authenticates via the GitHub App for a clean runner instance. - Persistent State & Nix Cache:
- Runner work directory:
../../var/lib/homelab/github_runner:/data(RUNNER_WORKDIR=/data/work). - Nix store cache: named Docker volume
nix-store:/nixso evaluated derivations persist across ephemeral restarts. If/nix/var/nix/profiles/default/bin/nixis missing or broken,entrypoint-nix.shseeds/nixfrom/opt/nix-seed.tar.gzand ensuresrunner:runnerownership.
- Runner work directory:
- Network Isolation: Intentionally not attached to
proxy-net; uses the default isolated Compose bridge for outbound HTTPS to GitHub only.
GitHub App Permissions
Create and install a dedicated GitHub App on your organization (for private repositories):
- Organization permissions:
Self-hosted runners: Read and write - Repository permissions:
Metadata: Read-only
Configuration
See .env-example for required runtime variables (stored in gitignored .env, chmod 0640):
GITHUB_RUNNER_SCOPE:org(default) orrepoGITHUB_RUNNER_ORG_NAME: Target GitHub organization slug (whenorg)GITHUB_RUNNER_APP_ID: GitHub App IDGITHUB_RUNNER_APP_LOGIN: GitHub App slug/loginGITHUB_RUNNER_APP_PRIVATE_KEY_B64: Single-line base64-encoded PEM (base64 -w0 < key.pem), decoded at container startup intoAPP_PRIVATE_KEYfor pure-Python.envcompatibility.GITHUB_RUNNER_LABELS: Comma-separated runner labels (defaultself-hosted,linux,x64,nix).