Files
nixos-config/hosts/common/default.nix
T
m3ta-chiron ed2f9ba4d2 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.
2026-08-31 11:47:17 +02:00

102 lines
2.9 KiB
Nix

# Common configuration for all hosts
{
config,
pkgs,
lib,
inputs,
outputs,
system,
...
}: {
imports = [
./extraServices
./ports.nix
./users
inputs.home-manager.nixosModules.home-manager
];
environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inputs = inputs // {agents = null;};
inherit outputs system;
videoDrivers = config.services.xserver.videoDrivers or [];
};
};
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
#outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.stable-packages
# outputs.overlays.locked-packages
# outputs.overlays.pinned-packages
outputs.overlays.master-packages
inputs.m3ta-nixpkgs.overlays.default
# inputs.m3ta-nixpkgs.overlays.modifications
# 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:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = {
settings = {
experimental-features = "nix-command flakes";
cores = 2;
max-jobs = 8;
trusted-users = [
"root"
"m3tam3re"
]; # Set users that are allowed to use the flake command
};
# Garbage collection is handled by programs.nh.clean on each host.
# Keep nix.gc.automatic disabled to avoid dueling GC timers.
optimise.automatic = true;
registry =
(lib.mapAttrs (_: flake: {inherit flake;}))
((lib.filterAttrs (_: lib.isType "flake")) inputs);
nixPath = ["/etc/nix/path"];
};
users.defaultUserShell = pkgs.bashInteractive;
programs.bash = {
enable = true;
interactiveShellInit = ''
# Interactive bash -> nushell, unless started deliberately from
# nu/bash (parent check — an exported env marker would leak into
# zellij/zed/herdr children). Non-interactive bash (ssh command
# exec, Mosh app bootstrap) stays bash.
if [[ $- == *i* ]]; then
parent=""
[[ -r /proc/$PPID/comm ]] && IFS= read -r parent < /proc/$PPID/comm
if [[ "$parent" != "nu" && "$parent" != "bash" ]]; then
exec ${pkgs.nushell}/bin/nu --login
fi
unset parent
fi
'';
};
}