libchat/flake.nix
Ivan FB aa33e199f4
chore: build the native library from source (flake, CI, docs)
liblogosdelivery is no longer consumed as a prebuilt Nix package; waku-bindings
compiles it from the Nim sources in its vendor submodule. The devShell drops the
prebuilt package and LOGOS_DELIVERY_LIB_DIR and instead supplies that build's
toolchain. CI checks out submodules recursively and caches the (slow, cold) Nim
build on the submodule commit; the toolchain-only jobs exclude every crate that
reaches the native lib, and format is scoped to workspace members so it never
rewrites the vendored generated sources.

Docs corrected along the way: the default transport is `file`, not
logos-delivery, and chat-cli no longer carries its own build.rs or a
logos_delivery transport module.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ai43sF2rymPFMG9iki9fwL
2026-07-18 17:31:28 +02:00

53 lines
1.7 KiB
Nix

{
description = "libchat - Logos Chat cryptographic library";
inputs = {
# nixos-unstable-small has both crates.io UA fixes (NixOS/nixpkgs#512735,
# NixOS/nixpkgs#524985); nixos-unstable hasn't caught up yet as of 2026-05-28.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, rust-overlay }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system;
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
});
in
{
devShells = forAllSystems ({ pkgs, ... }:
let
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust_toolchain.toml;
in
{
# liblogosdelivery is no longer consumed as a prebuilt package. The
# waku-bindings crate under vendor/ builds it from its own Nim vendor
# submodule (`make liblogosdelivery STATIC=1`) and offers no hook for
# a prebuilt one, so this shell supplies that build's toolchain rather
# than the library. The vendor's `make update` bootstraps its own
# pinned Nim compiler, so Nim itself is not listed here.
default = pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
pkgs.cmake
pkgs.git
pkgs.gnumake
pkgs.pkg-config
pkgs.perl
pkgs.protobuf
pkgs.which
];
};
}
);
};
}