Files
nix-config/pkgs/comment-checker/default.nix
T
imbytecat c73e36a1be feat: add opencode, comment-checker packages; update README and flake.lock
- Add opencode and comment-checker to home packages
- Package comment-checker via prebuilt GitHub Releases binaries
- Register comment-checker overlay and flake packages output
- Add flake.lock to pin dependency versions
- Update README to match actual repo structure
- Add Node.js version notes in languages.nix
2026-04-03 20:40:00 +08:00

56 lines
1.7 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{ lib
, stdenv
, fetchurl
, autoPatchelfHook
}:
let
version = "0.7.0";
# 预编译二进制来自 GitHub Releasesgoreleaser 构建,tree-sitter 已静态链接)
srcs = {
"aarch64-darwin" = {
url = "https://github.com/code-yeongyu/go-claude-code-comment-checker/releases/download/v${version}/comment-checker_v${version}_darwin_arm64.tar.gz";
hash = "sha256-0woeTNx7MXraKsshJB7aTkpnfi9GQn9dJEy+/VUfDX8=";
};
"x86_64-linux" = {
url = "https://github.com/code-yeongyu/go-claude-code-comment-checker/releases/download/v${version}/comment-checker_v${version}_linux_amd64.tar.gz";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
"aarch64-linux" = {
url = "https://github.com/code-yeongyu/go-claude-code-comment-checker/releases/download/v${version}/comment-checker_v${version}_linux_arm64.tar.gz";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
};
platformSrc = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation {
pname = "comment-checker";
inherit version;
src = fetchurl {
inherit (platformSrc) url hash;
};
sourceRoot = ".";
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
unpackPhase = ''
tar -xzf $src
'';
installPhase = ''
install -Dm755 comment-checker $out/bin/comment-checker
'';
meta = with lib; {
description = "Multi-language comment detection hook for Claude Code / OpenCode";
homepage = "https://github.com/code-yeongyu/go-claude-code-comment-checker";
license = licenses.mit;
platforms = [ "aarch64-darwin" "x86_64-linux" "aarch64-linux" ];
mainProgram = "comment-checker";
};
}