Files
Dario LipicarandClaude Opus 4.8 f1a5564afc Add flake + executable doc-test + Pages CI (publish like the other modules) (#3)
* feat: nix flake (cargo tests as checkPhase) + executable doc-test + CI

Adds a flake.nix that builds/tests the crate via rustPlatform (checkPhase runs
the fail-closed suite), an executable logos-doctest that runs those 6 invariant
tests in the pinned dev shell, run.sh, and the Pages-publishing CI — so this
repo publishes its doc-test like the other logos-evm-* modules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(doctest): render outputs/net-proxy-runtime.md (fail-closed suite, 6/6)

* fix(doctest): build the crate (checkPhase runs cargo test) instead of fragile source-fetch

The flake-metadata→cp→cd source juggling left cargo running in the wrong dir on
CI (could not find Cargo.toml). 'nix build #default' runs the suite in
rustPlatform's checkPhase; check_file: result is a cache-robust green assertion.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 14:00:49 -03:00

27 lines
1.0 KiB
Nix

{
description = "logos-net-proxy — fail-closed proxyable HTTP client constructor (the wallet's single outbound chokepoint). Building runs the fail-closed test suite.";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAll = f: nixpkgs.lib.genAttrs systems (s: f nixpkgs.legacyPackages.${s});
crate = pkgs: pkgs.rustPlatform.buildRustPackage {
pname = "logos-net-proxy";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
# buildRustPackage's checkPhase runs `cargo test` by default, so a
# successful build IS a green run of the fail-closed invariant suite.
};
in
{
packages = forAll (pkgs: { default = crate pkgs; });
checks = forAll (pkgs: { default = crate pkgs; });
devShells = forAll (pkgs: {
default = pkgs.mkShell { packages = [ pkgs.cargo pkgs.rustc pkgs.pkg-config ]; };
});
};
}