mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
Prepare the 2.1.2 patch release after archive cold-start production testing exposed and verified the post-2.1.1 sync corrections.
Promote the accumulated Unreleased entries, add a release summary, advance comparison links, and keep Cargo plus both Nix package definitions on the same version. This commit changes release metadata only.
The release prevents permanent relay refusals from rebuilding coverage in a tight loop, adapts request grouping to strict remote filter limits, preserves purgatory events during active Git work, exports service-wide resource metrics, and demotes routine missing-repository probes.
Production evidence: a clean b21683b archive burn-in created 2,575 repositories and 26 GiB of Git data while syncing more than 5,000 events, with no restart, watchdog recovery, repeated filter-count refusal, panic, OOM, or memory-pressure event. Memory remained below the configured 32 GiB pressure threshold. The one relay.jbnco.co four-filter refusal learned a two-filter session ceiling without repeating.
Validation: git diff --check; Cargo metadata and Nix package evaluation reported 2.1.2. Per operator direction, no new build or test run was required for this metadata-only commit.
97 lines
3.3 KiB
Nix
97 lines
3.3 KiB
Nix
{
|
|
description = "ngit-grasp - A GRASP implementation in Rust";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, rust-overlay, flake-utils }:
|
|
let
|
|
sourceRevision =
|
|
if self ? rev then self.rev
|
|
else if self ? dirtyRev then self.dirtyRev
|
|
else "unknown";
|
|
in
|
|
(flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
overlays = [ (import rust-overlay) ];
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
|
|
|
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
|
extensions = [ "rust-src" "rust-analyzer" ];
|
|
};
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
# Single dev shell for the whole workspace (ngit-grasp + grasp-audit).
|
|
buildInputs = with pkgs; [ rustToolchain pkg-config openssl git gitlint ];
|
|
|
|
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
|
|
|
|
shellHook = ''
|
|
echo "🚀 ngit-grasp workspace development environment"
|
|
echo "Rust version: $(rustc --version)"
|
|
echo ""
|
|
echo "Quick commands:"
|
|
echo " cargo build - Build the whole workspace"
|
|
echo " cargo test - Run ngit-grasp tests"
|
|
echo " cargo run - Run the relay"
|
|
echo " cargo build -p grasp-audit - Build the audit tool"
|
|
echo " cargo test -p grasp-audit - Run grasp-audit unit tests"
|
|
echo ""
|
|
'';
|
|
};
|
|
|
|
# Both crates are members of a single workspace sharing one Cargo.lock.
|
|
packages.default = self.packages.${system}.ngit-grasp;
|
|
|
|
packages.ngit-grasp = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "ngit-grasp";
|
|
version = "2.1.2";
|
|
src = ./.;
|
|
NGIT_BUILD_REVISION = sourceRevision;
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
# Only build/test the ngit-grasp package, not the whole workspace.
|
|
cargoBuildFlags = [ "-p" "ngit-grasp" ];
|
|
|
|
nativeBuildInputs = with pkgs; [ pkg-config git ];
|
|
|
|
buildInputs = with pkgs; [ openssl ];
|
|
|
|
# Run lib tests only; integration tests spawn a live relay and require
|
|
# network access not available in the Nix sandbox.
|
|
doCheck = true;
|
|
cargoTestFlags = [ "-p" "ngit-grasp" "--lib" ];
|
|
};
|
|
|
|
packages.grasp-audit = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "grasp-audit";
|
|
version = "0.2.0";
|
|
src = ./.;
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
cargoBuildFlags = [ "-p" "grasp-audit" ];
|
|
|
|
nativeBuildInputs = with pkgs; [ pkg-config git ];
|
|
|
|
buildInputs = with pkgs; [ openssl ];
|
|
|
|
# Audit tests require a running Nostr relay; skip in the sandbox.
|
|
doCheck = false;
|
|
};
|
|
})) // {
|
|
# NixOS module for deployment
|
|
nixosModules.default = { ... }: {
|
|
imports = [ ./nix/module.nix ];
|
|
_module.args.ngitGraspSourceRevision = sourceRevision;
|
|
};
|
|
nixosModules.ngit-grasp = self.nixosModules.default;
|
|
};
|
|
}
|