No description
  • Nix 64.4%
  • Shell 35.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
marti 63ccf6db0a
All checks were successful
Check / check (push) Successful in 1m55s
ci: keep upstream version and hashes in sources.json
update.sh finds the newest upstream version and rewrites sources.json,
taking each hash from what nix reports for a fake one, so it works for
any fetcher and for Go and npm dependency hashes alike. The update
workflow runs it daily, rewrites the README title, and pushes only if
the package builds and passes its smoke test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 16:48:13 +02:00
.forgejo/workflows ci: keep upstream version and hashes in sources.json 2026-10-12 16:48:13 +02:00
.gitignore feat: package open-code-review v1.12.12 as a flake 2026-10-07 12:47:14 +02:00
alejandra.toml feat: package open-code-review v1.12.12 as a flake 2026-10-07 12:47:14 +02:00
flake.lock feat: package open-code-review v1.12.12 as a flake 2026-10-07 12:47:14 +02:00
flake.nix ci: keep upstream version and hashes in sources.json 2026-10-12 16:48:13 +02:00
package.nix ci: keep upstream version and hashes in sources.json 2026-10-12 16:48:13 +02:00
README.md ci: keep upstream version and hashes in sources.json 2026-10-12 16:48:13 +02:00
sources.json ci: keep upstream version and hashes in sources.json 2026-10-12 16:48:13 +02:00
update.sh ci: keep upstream version and hashes in sources.json 2026-10-12 16:48:13 +02:00

open-code-review 1.12.12

A Nix flake packaging OpenCodeReview, Alibaba's AI-powered code review CLI. It reads git diffs, sends them to a configurable LLM provider and writes review comments.

On top of a plain buildGoModule it adds:

  • The ocr name. make builds the binary as opencodereview, but the upstream npm launcher and all of the docs call it ocr. The package installs ocr and keeps opencodereview as a link to it.
  • Shell completions for bash, zsh and fish, generated at build time.
  • git on the wrapped binary's PATH, since every review shells out to it.
  • Version info (ocr version) stamped the same way make does, from values hardcoded in package.nix so the build stays reproducible.

Built from source, so the npm launcher's update check (~/.opencodereview/update-available) is not part of it; updates come through this flake.

Usage

nix run git+https://git.cumsek.com/flakes/open-code-review -- --help
nix build .#open-code-review
{
	inputs.open-code-review.url = "git+https://git.cumsek.com/flakes/open-code-review";
}

Then either take the package directly:

environment.systemPackages = [inputs.open-code-review.packages.${pkgs.system}.default];

or add the overlay and use pkgs.open-code-review:

nixpkgs.overlays = [inputs.open-code-review.overlays.default];

Outputs: packages.<system>.{open-code-review,default}, apps.<system>.{ocr,default}, overlays.default, formatter, checks.

Updating

.forgejo/workflows/update.yml runs every night and on demand. It updates flake.lock, then runs update.sh to point sources.json at the newest upstream release (version, hash, vendorHash, and the commit and date of the release tag), and puts the new version in this README's title. If nix flake check passes it pushes to main, one commit for the lock and one for the package.

By hand, the same thing is:

nix flake update
nix shell --inputs-from . nixpkgs#curl nixpkgs#jq -c ./update.sh
nix flake check -L

commit is the short hash the tag points at and date that commit's date in UTC; make would read both from git, so they are recorded to keep the build reproducible. The hashes are the ones nix reports when update.sh builds open-code-review.src and open-code-review.goModules with a fake hash. Releases are listed at https://github.com/alibaba/open-code-review/releases.

Checks

nix flake check -L

Builds the package (running upstream's cmd/opencodereview tests), checks that ocr version reports the packaged version, and runs alejandra, deadnix, statix and shellcheck. CI runs the same command and nothing else.

Licence

The packaging is trivial; OpenCodeReview itself is under the Apache License 2.0, as recorded in meta.license.