Files
jackos1998andClaude Opus 5.5 a8a2303d2c demo: Build the app from slower, bigger parts
The demo's app built and copied in moments, which left nothing for the
progress in `slop` and the web app to show. It now has twelve parts in
three layers, each layer built once the one below it is, so a build
takes about a minute and a half; each part adds a few MiB to copy, and
the box VM has room for them. `demo-help` shows `--logs` too.

The parts follow from the version alone, so a version built before is
already in the builder's store and only evaluates, and a new one
rebuilds them all. `demo-bump` in the agents' VM sets a new version
and pushes it on a branch of its own, and a check runs it against a
bare copy of the repository, including from a fresh clone, as after
the VM restarts.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:33:15 +00:00

70 lines
2.7 KiB
Nix

{
description = "Approval broker that runs privileged operations for coding agents";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
inherit (nixpkgs) lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forSystems = f: lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
# The commit the package's version shows, if the flake is from Git
rev = self.shortRev or self.dirtyShortRev or null;
# Each module defaults its `package` to this flake's build for the system it's used on
withPackage = path: option: { lib, pkgs, ... }: {
imports = [ path ];
config = lib.setAttrByPath (option ++ [ "package" ])
(lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.default);
};
in
{
packages = forSystems (pkgs: rec {
slop-broker = pkgs.callPackage ./nix/package.nix { inherit rev; };
default = slop-broker;
# The demo's VMs (see `docs/demo.md`)
demo = import ./nix/demo/agent.nix { inherit pkgs slop-broker; };
demo-box = import ./nix/demo/box.nix { inherit pkgs; };
});
overlays.default = final: _prev: {
slop-broker = final.callPackage ./nix/package.nix { inherit rev; };
};
nixosModules = {
slop-broker = withPackage ./nix/modules/nixos/broker.nix [ "services" "slop-broker" ];
slop-broker-builder = withPackage ./nix/modules/nixos/builder.nix [ "services" "slop-broker-builder" ];
slop-broker-cache = ./nix/modules/nixos/cache.nix;
default = {
imports = with self.nixosModules; [ slop-broker slop-broker-builder slop-broker-cache ];
};
};
homeModules = rec {
slop = withPackage ./nix/modules/home-manager/slop.nix [ "programs" "slop" ];
default = slop;
};
# The VM test needs KVM
checks = forSystems (pkgs: {
package = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
vm = pkgs.callPackage ./nix/vm-test.nix { slop-broker = self.packages.${pkgs.stdenv.hostPlatform.system}.default; };
demo-bump = import ./nix/demo/bump-test.nix { inherit pkgs; };
} // import ./nix/lints.nix { inherit pkgs; slop-broker = self.packages.${pkgs.stdenv.hostPlatform.system}.default; });
# A plain alternative to the devenv shell, for `nix develop`: the toolchain and the build's
# inputs, without devenv's scripts or the demo
devShells = forSystems (pkgs: {
default = pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.stdenv.hostPlatform.system}.default ];
packages = with pkgs; [ clippy rustfmt rust-analyzer git nixpkgs-fmt ];
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
};
});
formatter = forSystems (pkgs: pkgs.nixpkgs-fmt);
};
}