Files
boxmaker/flake.nix
T
kyleandClaude Opus 5.5 d2e6cfa51f flake: Rust 1.98.1 from rust-overlay; rust-version 1.98
The owner's hosts (titan, talos) run 1.98.1; nixos-26.05's Rust is
1.95.0, so builds and lints differed by host. The flake gains a second
input, oxalica's rust-overlay (following our nixpkgs, so host configs
can still follow theirs), and both the package build and the dev shell
use its stable 1.98.1 with clippy and rustfmt. The workspace's
rust-version rises to 1.98 to match; AGENTS.md, docs/dependencies.md
and the M5c-1 plan follow.

Checked on straylight: nix build gives all seven binaries; the dev
shell has rustc, cargo and clippy 1.98.1, rustfmt 1.9.0, cargo-deny
0.19.6; make gate in it passes with 1122 tests, as on titan.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 00:04:38 -07:00

106 lines
3.0 KiB
Nix

{
description = "boxmaker: a sovereign personal agent harness";
inputs = {
nixpkgs.url = "nixpkgs/nixos-26.05";
# The Rust toolchain, pinned below, independent of the host's nixpkgs release.
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
rust-overlay,
}:
let
systems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
# nixpkgs with rust-overlay, and the one Rust toolchain every host uses (the workspace's
# `rust-version`): cargo, rustc, clippy and rustfmt.
pkgsFor =
system:
import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
toolchainFor =
pkgs:
pkgs.rust-bin.stable."1.98.1".default.override {
extensions = [
"clippy"
"rustfmt"
];
};
version =
if self ? shortRev then
self.shortRev
else if self ? dirtyShortRev then
self.dirtyShortRev
else
"dev";
in
{
packages = forAllSystems (
system:
let
pkgs = pkgsFor system;
toolchain = toolchainFor pkgs;
rustPlatform = pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
lib = pkgs.lib;
# Only what the build reads: no target/, no .state/, no docs.
src = lib.cleanSourceWith {
src = ./.;
filter =
path: type:
let
rel = lib.removePrefix (toString ./. + "/") (toString path);
in
rel == "Cargo.toml" || rel == "Cargo.lock" || rel == "crates" || lib.hasPrefix "crates/" rel;
};
# Every binary of the workspace: the roles, bxctl and toolkit.
boxmaker = rustPlatform.buildRustPackage {
pname = "boxmaker";
inherit version src;
cargoLock.lockFile = ./Cargo.lock;
# The tests run in `make gate`: they need Unix sockets under /tmp and scripts they write
# and run, which the build sandbox is not checked to allow.
doCheck = false;
meta = {
description = "a sovereign personal agent harness";
mainProgram = "bxctl";
};
};
# The image every tool container runs from; see the file for how it is loaded.
tools-image = import ./deploy/tools-image.nix { inherit pkgs; };
in
{
inherit boxmaker tools-image;
default = boxmaker;
}
);
devShells = forAllSystems (
system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
(toolchainFor pkgs)
pkgs.cargo-deny
pkgs.gnumake
];
};
}
);
};
}