Classify every comment as tautology, stale, excuse or decision record. Tautology/stale/excuse comments are deleted (excuses filed as issues #196-#236), decisions moved to docs/adr/0001-0034. - scripts/lint-comments.sh + .comment-baseline: per-file comment count may only go down; wired into tests/all.sh - .claude/skills/delete-comment: repeatable audit workflow - cargo fmt applied to touched crates Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
74 lines
2.6 KiB
Nix
74 lines
2.6 KiB
Nix
{
|
|
description = "hx: minimal Rust coding agent";
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
|
|
forAll = f: nixpkgs.lib.genAttrs systems (s: f nixpkgs.legacyPackages.${s});
|
|
bin = builtins.fromJSON (builtins.readFile ./bin.json);
|
|
targets = {
|
|
x86_64-linux = "x86_64-unknown-linux-musl";
|
|
aarch64-darwin = "aarch64-apple-darwin";
|
|
};
|
|
in
|
|
{
|
|
packages = forAll (
|
|
pkgs:
|
|
let
|
|
target = targets.${pkgs.stdenv.hostPlatform.system} or "";
|
|
hasBin = bin.sha256 ? ${target};
|
|
|
|
hx = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "hx";
|
|
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
|
|
src = pkgs.lib.cleanSource ./.;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
cargoBuildFlags = [ "-p" "hx-cli" ];
|
|
doCheck = false;
|
|
nativeBuildInputs = [ pkgs.cmake pkgs.perl ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.makeWrapper ];
|
|
dontUseCmakeConfigure = true;
|
|
postInstall = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux ''
|
|
wrapProgram $out/bin/hx --suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.bubblewrap ]}
|
|
'';
|
|
meta = {
|
|
description = "Minimal Rust coding agent using existing subscriptions";
|
|
license = pkgs.lib.licenses.unlicense;
|
|
mainProgram = "hx";
|
|
};
|
|
};
|
|
|
|
hx-bin = pkgs.runCommand "hx-${bin.version}" { meta.mainProgram = "hx"; } ''
|
|
mkdir -p $out/bin
|
|
tar -xzf ${
|
|
pkgs.fetchurl {
|
|
url = "https://git.jokresner.de/johannes/hx/releases/download/v${bin.version}/hx-${target}.tar.gz";
|
|
sha256 = bin.sha256.${target};
|
|
}
|
|
} -C $out/bin hx
|
|
'';
|
|
in
|
|
{
|
|
inherit hx;
|
|
default = if hasBin then hx-bin else hx;
|
|
}
|
|
// pkgs.lib.optionalAttrs hasBin { inherit hx-bin; }
|
|
);
|
|
|
|
apps = forAll (pkgs: rec {
|
|
hx = { type = "app"; program = "${self.packages.${pkgs.system}.default}/bin/hx"; };
|
|
default = hx;
|
|
});
|
|
|
|
overlays.default = _: prev: { hx = self.packages.${prev.system}.default; };
|
|
|
|
devShells = forAll (pkgs: {
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [ cargo rustc clippy rustfmt rust-analyzer git ] ++ pkgs.lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.bubblewrap;
|
|
};
|
|
});
|
|
};
|
|
}
|