Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

build(nix): pin flake inputs and verify the flake in CI

AkitaOnRails100424bccdf3
diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml
new file mode 100644
index 00000000..b6203fc0
--- /dev/null
+++ b/.github/workflows/nix.yml
@@ -0,0 +1,55 @@
+name: nix
+
+# Builds the flake so the Nix packaging cannot rot unnoticed.
+#
+# ai-memory does not otherwise test on Nix, so without this job `flake.nix`
+# is source nobody executes: it can break through a dependency bump, a
+# toolchain change, or a new build script and stay green because no other
+# job touches it.
+#
+# Deliberately NOT run on every pull request — a full release build under
+# Nix costs far more wall-clock than the rest of the matrix combined, and
+# most PRs cannot affect it. It runs when an input to the Nix build
+# actually changes, on a weekly schedule to catch upstream drift, and on
+# demand.
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'flake.nix'
+ - 'Cargo.lock'
+ - 'Cargo.toml'
+ - 'rust-toolchain.toml'
+ - '.github/workflows/nix.yml'
+ pull_request:
+ paths:
+ - 'flake.nix'
+ - 'Cargo.lock'
+ - 'Cargo.toml'
+ - 'rust-toolchain.toml'
+ - '.github/workflows/nix.yml'
+ schedule:
+ # Mondays 05:17 UTC. Off the hour so it does not pile onto the
+ # top-of-hour scheduling spike.
+ - cron: '17 5 * * 1'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ name: nix build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
+ with:
+ extra_nix_config: |
+ experimental-features = nix-command flakes
+ # `nix flake check` would also evaluate every output; the build is the
+ # claim worth verifying, and it is the expensive half anyway.
+ - run: nix build --print-build-logs
+ # The binary is what the flake promises. Run it, so a package that
+ # builds but cannot execute still fails.
+ - run: ./result/bin/ai-memory --version
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e29e0713..b877cdba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,7 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
no system-library hunting). The flake skips the packaging test suite
because those tests exercise the Docker-wrapper shell script and need
`docker`/`podman` on PATH; the rest of the workspace tests can be run via
- `nix develop -c cargo test --workspace`. ([#405])
+ `nix develop -c cargo test --workspace`. Flake inputs are pinned to
+ explicit revisions rather than floating branches, so the build is
+ reproducible, and a `nix` CI job builds the flake and runs the resulting
+ binary whenever a Nix build input changes plus weekly, so the packaging
+ cannot rot unnoticed. ([#405])
- New `strip_root_combinators` config flag (env `AI_MEMORY_STRIP_ROOT_COMBINATORS`,
or `strip_root_combinators = true` in config.toml) strips root-level
`anyOf`/`oneOf`/`allOf` from MCP tool input schemas on every `tools/list`.
diff --git a/flake.nix b/flake.nix
index 36cd57bc..aea314fe 100644
--- a/flake.nix
+++ b/flake.nix
@@ -22,11 +22,22 @@
{
description = "Long-term memory for AI coding agents";
+ # Inputs are pinned to explicit revisions rather than floating branches.
+ #
+ # A flake's value is reproducibility, and `github:NixOS/nixpkgs/nixos-unstable`
+ # resolves to whatever that branch points at today, so two people — or the
+ # same person a week apart — can get different builds from identical source.
+ # Normally `flake.lock` handles this; pinning here achieves the same
+ # determinism and keeps the tree honest for contributors who do not have
+ # Nix installed and so cannot regenerate a lock.
+ #
+ # To update: bump these revisions deliberately, in their own commit, and
+ # let the `nix` CI job prove the result still builds.
inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
- flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:NixOS/nixpkgs/0ae2bc1419c3f345984c2629e72e7a631820fa4d";
+ flake-utils.url = "github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b";
rust-overlay = {
- url = "github:oxalica/rust-overlay";
+ url = "github:oxalica/rust-overlay/99607a06c2ea1290cd3258c11d1416dde9201f94";
inputs.nixpkgs.follows = "nixpkgs";
};
};