Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Changed
- **Version re-baselined to `0.1.0`** across `main.go`, `api/server.go`, `flake.nix`,
`.github/workflows/release.yml`, and the `update`/`api` test suites, aligning hawk
- **Version re-baselined to `0.1.0`** across `cmd/hawk/main.go`, `cmd/daemon.go`,
`flake.nix`, `.github/workflows/release.yml`, and the `update`/daemon test suites, aligning hawk
with the rest of the GrayCodeAI ecosystem (`eyrie`, `tok`, `yaad`, `sight`, `inspect`).

### Added
Expand Down
2 changes: 0 additions & 2 deletions cmd/hawk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"

"github.com/GrayCodeAI/hawk/cmd"
"github.com/GrayCodeAI/hawk/internal/api"
"github.com/GrayCodeAI/hawk/internal/hawkerr"
"github.com/GrayCodeAI/hawk/internal/mcp"
"github.com/GrayCodeAI/hawk/internal/sandbox"
Expand Down Expand Up @@ -37,7 +36,6 @@ func main() {
// to avoid an import cycle with main.
cmd.SetVersion(Version)
cmd.SetBuildDate(BuildDate)
api.SetVersion(Version)
mcp.SetClientVersion(Version)
sandbox.ContainerImageTag = Version

Expand Down
79 changes: 70 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,91 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
# GrayCodeAI sibling repos — the public Go proxy has stale v0.1.0 tags
# (post-history-rewrite), so resolve them locally like the Dockerfile.
eyrie = { url = "github:GrayCodeAI/eyrie"; flake = false; };
inspect = { url = "github:GrayCodeAI/inspect"; flake = false; };
sight = { url = "github:GrayCodeAI/sight"; flake = false; };
tok = { url = "github:GrayCodeAI/tok"; flake = false; };
trace = { url = "github:GrayCodeAI/trace"; flake = false; };
yaad = { url = "github:GrayCodeAI/yaad"; flake = false; };
};

outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, eyrie, inspect, sight, tok, trace, yaad }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

inherit (pkgs) lib;

siblings = {
"github.com/GrayCodeAI/eyrie" = eyrie;
"github.com/GrayCodeAI/inspect" = inspect;
"github.com/GrayCodeAI/sight" = sight;
"github.com/GrayCodeAI/tok" = tok;
"github.com/GrayCodeAI/trace" = trace;
"github.com/GrayCodeAI/yaad" = yaad;
};

# GrayCode modules currently follow github.com/<org>/<name>, so the
# last path segment matches the sibling checkout directory name.
dirOf = mod: lib.last (lib.splitString "/" mod);
goVer = lib.removePrefix "go" "${pkgs.go_1_26.version}";

# Copy sibling sources into external/, patch the go.mod go directive
# to match the nixpkgs Go version, and add replace directives so the
# build resolves siblings locally instead of hitting the stale proxy.
setupReplace = ''
sed -i 's/^go [0-9.]\+/go ${goVer}/' go.mod
rm -f go.work go.work.sum
mkdir -p external
${lib.concatStringsSep "\n" (lib.mapAttrsToList (mod: src:
"cp -r ${src} external/${dirOf mod}"
) siblings)}
${lib.concatStringsSep "\n" (lib.mapAttrsToList (mod: _:
"tmp_go_mod=$(mktemp) && awk '$0 != \"replace ${mod} => ./external/${dirOf mod}\"' go.mod > \"$tmp_go_mod\" && mv \"$tmp_go_mod\" go.mod"
) siblings)}
${lib.concatStringsSep "\n" (lib.mapAttrsToList (mod: _:
"echo \"replace ${mod} => ./external/${dirOf mod}\" >> go.mod"
) siblings)}
'';

hawk = pkgs.buildGoModule rec {
pname = "hawk";
version = "0.1.0";

src = ./.;


# The public Go proxy has stale v0.1.0 tags for GrayCodeAI sibling
# modules (post-history-rewrite). We resolve siblings locally via
# replace directives in go.mod (added in preBuild below). External
# deps (charmbracelet, cobra, …) are fetched from the proxy. The
# vendor FOD is skipped (null) because the proxy version mismatch
# prevents `go mod vendor` from passing checksum verification.
vendorHash = null;


env = {
GOPRIVATE = "github.com/GrayCodeAI/*";
GONOSUMDB = "github.com/GrayCodeAI/*";
GONOSUMCHECK = "1";
GOFLAGS = "-mod=mod";
};

# Add replace directives to go.mod so the build and vendor FOD
# resolve sibling modules locally instead of from the stale proxy.
preBuild = setupReplace;
overrideModAttrs = old: {
preBuild = setupReplace;
};

ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];

nativeBuildInputs = [ pkgs.git ];
meta = with pkgs.lib; {

meta = with lib; {
description = "AI coding agent that reads, writes, and runs code in your terminal";
homepage = "https://github.com/GrayCodeAI/hawk";
license = licenses.mit;
Expand All @@ -38,7 +99,7 @@
{
packages = {
default = hawk;
hawk = hawk;
inherit hawk;
};

devShells.default = pkgs.mkShell {
Expand Down
253 changes: 0 additions & 253 deletions internal/api/server.go

This file was deleted.

Loading
Loading