refactor(llm-agents): replace flattening overlay with upstream shared-nixpkgs
Drop the custom mkLlmAgentsOverlay factory (172 top-level attrs + 17-entry blocklist guarding against nixpkgs clobbering — the source of the webcord buildNpmPackage and fetchPnpmDeps stack overflows). Apply inputs.llm-agents.overlays.shared-nixpkgs directly instead. It exposes everything under the pkgs.llm-agents.* namespace and clobbers nothing, so the blocklist becomes unnecessary. Packages stay built against this system's nixpkgs (allowUnfree), which qmd.override cudaSupport in the m3-ares NVIDIA specialisation requires. Consumers switched to namespaced refs: - hosts/m3-hermes/services/hermes-agent.nix: herdr, opencode, qmd - m3ta-home agents.nix (input bumped): agent-browser, beads, herdr, qmd, openspec — unqualified refs would now silently resolve to outdated nixpkgs attrs (opencode 0.3.x) or vanish. openspec pass-through dropped from m3ta-nixpkgs (input bumped): llm-agents is the single source of truth now. Note: flake.nix/lock carry the pre-existing local path inputs for m3ta-home and m3ta-nixpkgs (dev state, gitea URLs kept as comments). Verified: drvPath evals for m3-hermes, m3-atlas, and the m3-ares NVIDIA specialisation (qmd + CUDA EULA) all pass; statix/deadnix clean.
This commit is contained in:
@@ -23,8 +23,9 @@
|
|||||||
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
||||||
|
|
||||||
m3ta-nixpkgs = {
|
m3ta-nixpkgs = {
|
||||||
url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs";
|
# url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs";
|
||||||
# url = "path:/home/m3tam3re/p/NIX/nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
url = "path:/home/m3tam3re/p/NIX/nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
llm-agents.url = "github:numtide/llm-agents.nix";
|
||||||
@@ -76,8 +77,7 @@
|
|||||||
in {
|
in {
|
||||||
packages =
|
packages =
|
||||||
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||||
overlays = removeAttrs allOverlays ["mkLlmAgentsOverlay"];
|
overlays = allOverlays;
|
||||||
lib.mkLlmAgentsOverlay = allOverlays.mkLlmAgentsOverlay;
|
|
||||||
homeManagerModules = import ./modules/home-manager;
|
homeManagerModules = import ./modules/home-manager;
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|||||||
@@ -40,7 +40,11 @@
|
|||||||
|
|
||||||
inputs.m3ta-nixpkgs.overlays.default
|
inputs.m3ta-nixpkgs.overlays.default
|
||||||
# inputs.m3ta-nixpkgs.overlays.modifications
|
# inputs.m3ta-nixpkgs.overlays.modifications
|
||||||
(outputs.lib.mkLlmAgentsOverlay system)
|
# llm-agent packages under the `pkgs.llm-agents.*` namespace, built
|
||||||
|
# against this system's nixpkgs (needed for qmd.override cudaSupport
|
||||||
|
# with allowUnfree). Do NOT flatten to top-level attrs — see
|
||||||
|
# overlays/default.nix.
|
||||||
|
inputs.llm-agents.overlays.shared-nixpkgs
|
||||||
# You can also add overlays exported from other flakes:
|
# You can also add overlays exported from other flakes:
|
||||||
# neovim-nightly-overlay.overlays.default
|
# neovim-nightly-overlay.overlays.default
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ in {
|
|||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
basecamp
|
basecamp
|
||||||
docker
|
docker
|
||||||
herdr
|
llm-agents.herdr
|
||||||
opencode
|
llm-agents.opencode
|
||||||
pi-coding-agent
|
pi-coding-agent
|
||||||
bun
|
bun
|
||||||
git
|
git
|
||||||
@@ -83,7 +83,7 @@ in {
|
|||||||
tea
|
tea
|
||||||
nix
|
nix
|
||||||
python3Minimal
|
python3Minimal
|
||||||
qmd
|
llm-agents.qmd
|
||||||
uv
|
uv
|
||||||
zellij
|
zellij
|
||||||
];
|
];
|
||||||
|
|||||||
+6
-52
@@ -48,56 +48,10 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Factory: not a proper overlay itself — takes system to avoid the infinite
|
# llm-agent packages (qmd, herdr, beads, …) come from
|
||||||
# recursion that occurs when accessing final/prev.system while the fixed-point
|
# inputs.llm-agents.overlays.shared-nixpkgs, applied directly in
|
||||||
# is still being computed. Exposed via outputs.lib, not outputs.overlays.
|
# hosts/common/default.nix. They are consumed via the `pkgs.llm-agents.*`
|
||||||
#
|
# namespace — no flattening to top-level attributes (that clobbered
|
||||||
# Use llm-agents' shared-nixpkgs overlay so packages with optional GPU support
|
# nixpkgs attrs like buildNpmPackage/fetchPnpmDeps and needed a
|
||||||
# (notably qmd) are built against this system's pkgs/config. Using the flake's
|
# hard-to-maintain blocklist).
|
||||||
# pre-built `packages.${system}` set pins them to llm-agents' own nixpkgs,
|
|
||||||
# where allowUnfree is false; qmd.override { cudaSupport = true; } then fails
|
|
||||||
# on CUDA EULA packages during the m3-ares NVIDIA specialisation build.
|
|
||||||
#
|
|
||||||
# Keep the exposed top-level package names aligned with llm-agents' filtered
|
|
||||||
# flake packages, but take the package values from the shared package set.
|
|
||||||
# Filters out internal helpers (marked `passthru.hideFromDocs = true`
|
|
||||||
# upstream) that would otherwise clobber nixpkgs attributes. Most critically
|
|
||||||
# this excludes `buildNpmPackage` — llm-agents' buildNpmPackage is a guarded
|
|
||||||
# re-export whose `__functor`/`override` interaction with makeOverridable
|
|
||||||
# breaks any package (e.g. nixpkgs' webcord) that calls
|
|
||||||
# `buildNpmPackage.override { nodejs = ...; }`. See numtide/llm-agents.nix
|
|
||||||
# commit 40490259 and the wrapper at packages/buildNpmPackage/package.nix.
|
|
||||||
mkLlmAgentsOverlay = system: final: prev: let
|
|
||||||
sharedPackages = (inputs.llm-agents.overlays.shared-nixpkgs final prev).llm-agents or {};
|
|
||||||
exposedPackageNames =
|
|
||||||
builtins.filter
|
|
||||||
(name: inputs.nixpkgs.lib.hasAttrByPath [name] sharedPackages)
|
|
||||||
(builtins.attrNames (inputs.llm-agents.packages.${system} or {}));
|
|
||||||
exposedPackages =
|
|
||||||
builtins.listToAttrs
|
|
||||||
(map (name: {
|
|
||||||
inherit name;
|
|
||||||
value = sharedPackages.${name};
|
|
||||||
})
|
|
||||||
exposedPackageNames);
|
|
||||||
in
|
|
||||||
builtins.removeAttrs exposedPackages [
|
|
||||||
# Internal helpers from packages/* marked hideFromDocs upstream:
|
|
||||||
"antigravity"
|
|
||||||
"auto-claude"
|
|
||||||
"buildNpmPackage" # ← the culprit; breaks webcord's `buildNpmPackage.override { nodejs = ...; }`
|
|
||||||
"bun2nix"
|
|
||||||
"darwinOpenptyHook"
|
|
||||||
"default" # fzf launcher; collides with nothing in nixpkgs but kept out for hygiene
|
|
||||||
"dolt" # collides with nixpkgs.dolt (Dolt database); not used in this config
|
|
||||||
"flake-inputs"
|
|
||||||
"forge"
|
|
||||||
"formatelf"
|
|
||||||
"formatter" # collides conceptually with pkgs.formatter; not used here
|
|
||||||
"go-bin"
|
|
||||||
"unpinCargoMsrvHook"
|
|
||||||
"unpinGoModVersionHook"
|
|
||||||
"versionCheckHomeHook"
|
|
||||||
"wrapBuddy"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user