Guide for coding agents working in this repository.
github-copilot-nix is a small standalone flake that packages the official
github/copilot-cli release tarballs for Linux and macOS.
The repository is intentionally narrow:
- expose
github-copilot-clias a flake package, app, and overlay - pin the packaged upstream version and hashes in
sources.json - automate version bumps with
scripts/update-version.sh - build/test in GitHub Actions
- tag only packaged releases
flake.nix/flake.lock— flake entrypoint and locked inputspackage.nix— derivation for thecopilotbinarysources.json— source of truth for packaged version and per-platform hashesscripts/update-version.sh— updatessources.json, refreshesflake.lock, verifies buildscripts/setup-github-permissions.sh— helper text for required GitHub settings.github/workflows/build.yml— CI build and smoke test.github/workflows/update-github-copilot-cli.yml— scheduled/manual update PR workflow.github/workflows/create-version-tag.yml— creates exact and moving tags for new packaged releasesREADME.md— user-facing docs
flake.nixexposes:packages.defaultpackages.github-copilot-cliapps.defaultapps.github-copilot-clioverlays.default
- Import nixpkgs with
config.allowUnfree = true; the packaged upstream binary is unfree. package.nixmust keepsources.jsonas the only version/hash source.- The installed program name is
copilot, notgithub-copilot-cli.
sources.jsonis the canonical place for:- packaged upstream version
- asset name per supported system
- fixed SRI hash per supported system
- Supported systems are currently:
x86_64-linuxaarch64-linuxx86_64-darwinaarch64-darwin
- Asset names follow upstream release naming:
copilot-linux-x64copilot-linux-arm64copilot-darwin-x64copilot-darwin-arm64
- Prefer
./scripts/update-version.shover manual edits when bumping versions. - The update script:
- discovers the latest upstream release
- downloads upstream
SHA256SUMS.txt - converts hashes to SRI
- rewrites
sources.json - runs
nix flake update - verifies with
nix build .#github-copilot-cliand./result/bin/copilot --version
- Keep the script simple and shell-only; do not add extra tooling unless necessary.
build.ymlis the main CI surface and should keep building on Ubuntu and macOS.update-github-copilot-cli.ymlshould only open a PR when the packaged version actually changes.create-version-tag.ymlshould:- create exact tag
vX.Y.Zfor new packaged versions - move
vXandlatestonly when a new exact version is created - leave moving tags untouched if the packaged version is unchanged
- create exact tag
- Do not add Cachix or other binary-cache assumptions unless explicitly requested.
- Update
README.mdwhen changing:- user installation flow
- flake outputs
- update automation
- tag semantics
- trust/security behavior
- Keep README examples valid for this repo; do not leave copied references to other projects.
- Preserve attribution to the original packaging approach from
sadjow/claude-code-nix.
- Prefer small changes in the existing files over adding new abstraction layers.
- Keep
sources.jsonmachine-editable and stable in shape. - Do not rename the
copilotexecutable or change public flake outputs unless the user asks. - Do not rewrite workflow behavior around tagging/update cadence without also updating README docs.
- Do not manually retag
v1/latestfor dependency-only changes when the packaged Copilot version is unchanged. - Do not introduce secrets into the repository; workflows rely on GitHub-provided tokens/settings.
Use the smallest relevant validation set for the change:
- docs only:
git diff --check
- shell/workflow/docs changes:
bash -n scripts/*.shgit diff --check
- package/update changes:
nix flake check --print-build-logsnix build .#github-copilot-cli -o result --print-build-logs./result/bin/copilot --version
- updater changes:
./scripts/update-version.sh --latest-version./scripts/update-version.sh --check
Automated update PRs require repository settings that allow Actions to:
- use
GITHUB_TOKENwith read/write permissions - create pull requests
- use auto-merge if that workflow step is enabled
See .github/REPOSITORY_SETTINGS.md when working on update automation.