23 lines
973 B
Nix
23 lines
973 B
Nix
# Named, explicitly-filtered source views of this repo. Each real
|
|
# consumer gets its own filtered derivation used as `src`, rather than
|
|
# an inline filter at the use site. Companion to the rust `cleanSrc`
|
|
# (crane's cargo-source filter — see ./rust.nix).
|
|
{ lib }:
|
|
{
|
|
# Filtered view of this repo the swarm builder builds on as its `hyperhive`
|
|
# input. Drops files no nix or cargo derivation reads — shell helper
|
|
# scripts and root-level markdown. `docs/` is kept: the agent base's
|
|
# `reference-docs` package builds from it.
|
|
hyperhiveFlakeSource = lib.cleanSourceWith {
|
|
name = "hyperhive-flake-source";
|
|
src = ../.;
|
|
filter =
|
|
path: type:
|
|
let
|
|
# Repo-relative path (strip the absolute source-dir prefix).
|
|
rel = lib.removePrefix (toString ../. + "/") (toString path);
|
|
in
|
|
!(lib.hasPrefix "scripts/" rel || rel == "scripts")
|
|
&& !(type == "regular" && !lib.hasInfix "/" rel && lib.hasSuffix ".md" rel);
|
|
};
|
|
}
|