The identity lived in the m3-hermes service and in home-manager session variables. Neither reaches the T3 desktop app on m3-kratos, so its agents committed and pushed as m3tam3re. Wrap the T3 packages via an overlay so everything T3 spawns inherits commit identity and Gitea push auth, independent of host and launcher. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
183 lines
7.4 KiB
Nix
183 lines
7.4 KiB
Nix
{inputs, ...}: {
|
|
# This one brings our custom packages from the 'pkgs' directory
|
|
# additions = final: prev:
|
|
# (import ../pkgs {pkgs = final;})
|
|
# // {rose-pine-hyprcursor = inputs.rose-pine-hyprcursor.packages.${prev.system}.default;};
|
|
|
|
# This one contains whatever you want to overlay
|
|
# You can change versions, add patches, set compilation flags, anything really.
|
|
# https://nixos.wiki/wiki/Overlays
|
|
modifications = final: prev: {
|
|
# aardvark-dns 2.x has a DNS forwarding bug breaking external name
|
|
# resolution in podman networks — pin to last 1.x from nixpkgs-stable.
|
|
aardvark-dns = import ./mods/aardvark-dns.nix {inherit (final) stable;};
|
|
|
|
# font-manager 0.9.4 does not compile against gtk4 4.22 (Vala errors
|
|
# in Gtk.DragIcon.get_for_drag) — apply the upstream fix from
|
|
# FontManager/font-manager#468 until our nixpkgs lock carries it.
|
|
# font-manager = import ./mods/font-manager.nix {inherit prev;};
|
|
|
|
# rofi-pass{,-wayland} were removed from nixpkgs on 2026-09-04
|
|
# ("unmaintained upstream"). m3ta-home's rofi module and the Hyprland
|
|
# mod+P keybind still use them — resurrect via overlay until a
|
|
# maintained replacement is packaged upstream.
|
|
rofi-pass = final.callPackage ./mods/rofi-pass.nix {};
|
|
rofi-pass-wayland = final.callPackage ./mods/rofi-pass.nix {backend = "wayland";};
|
|
# OpenCode v1 attribute names now point at the v2 packages (binary names
|
|
# stay `opencode2` / `opencode2-desktop`). Re-pinned after m3ta-nixpkgs'
|
|
# overlay in the `ai-agents` overlay below.
|
|
opencode = final.llm-agents.opencode2;
|
|
opencode-desktop = final.llm-agents.opencode2-desktop;
|
|
|
|
# nixpkgs#573479 (upstream fix on master, not yet in our lock): building
|
|
# khal's sphinx docs as separate "html" + "man" builders produces no man
|
|
# pages, so the declared man output never materializes → "failed to
|
|
# produce output path for output 'man'". Upstream builds "html man" in
|
|
# one invocation; mirror that until the lock advances past the fix.
|
|
khal = prev.khal.overrideAttrs (old: {
|
|
sphinxBuilders = ["html man"];
|
|
});
|
|
|
|
# Kernel 6.18 kbuild runs depmod during out-of-tree `modules_install`,
|
|
# which writes EMPTY depmod metadata (modules.builtin*, modules.dep, …)
|
|
# into module package outputs. The kernel's own non-empty files collide
|
|
# with them in the modules tree buildEnv (pkgs.aggregateModules →
|
|
# config.system.modulesTree): "two given paths contain a conflicting
|
|
# subpath: … modules.builtin.alias.bin". aggregateModules regenerates
|
|
# all metadata for the merged tree anyway, so the stray files are
|
|
# useless. Drop this overlay once nixpkgs carries a proper fix
|
|
# (checked: not in nixpkgs-master as of 2026-10-22).
|
|
linuxPackages = prev.linuxPackages.extend (_lpFinal: lpPrev: {
|
|
v4l2loopback = lpPrev.v4l2loopback.overrideAttrs (old: {
|
|
postInstall =
|
|
(old.postInstall or "")
|
|
+ ''
|
|
rm -f $out/lib/modules/*/modules.alias* \
|
|
$out/lib/modules/*/modules.builtin* \
|
|
$out/lib/modules/*/modules.dep* \
|
|
$out/lib/modules/*/modules.devname \
|
|
$out/lib/modules/*/modules.softdep \
|
|
$out/lib/modules/*/modules.symbols*
|
|
'';
|
|
});
|
|
});
|
|
};
|
|
|
|
# Top-level pins for the OpenCode packages from llm-agents. Applied
|
|
# AFTER m3ta-nixpkgs' overlay in hosts/common/default.nix — that overlay
|
|
# re-exports `opencode-desktop` from its own `opencode` flake input
|
|
# (github:anomalyco/opencode, v1 line), which would clobber a pin placed
|
|
# in `modifications`.
|
|
ai-agents = final: _prev: {
|
|
# OpenCode Desktop: v2 app (ai.opencode.desktop, 2.0.x) from llm-agents.
|
|
# Must stay AFTER m3ta-nixpkgs' overlay so the v1 re-export loses.
|
|
opencode-desktop = final.llm-agents.opencode2-desktop;
|
|
};
|
|
|
|
# T3 Code agents act as the m3ta-chiron bot on every host. Baked into the
|
|
# T3 packages rather than a session or service: everything T3 spawns
|
|
# inherits it, however T3 was launched (desktop launcher, systemd, shell),
|
|
# and any host installing T3 gets it. Must come AFTER shared-nixpkgs.
|
|
#
|
|
# Push auth needs ~/.ssh/m3ta-chiron on each host, with its pubkey on the
|
|
# m3ta-chiron Gitea account. A missing key fails the push instead of falling
|
|
# back to a personal key. Other hosts keep the user's own ssh config.
|
|
t3code-agent-identity = final: prev: let
|
|
identity = {
|
|
name = "m3ta-chiron";
|
|
email = "m3ta-chiron@agentmail.to";
|
|
};
|
|
|
|
giteaKnownHosts = final.writeText "gitea-known-hosts" ''
|
|
code.m3ta.dev ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFmmqZ4GgDEXJgj8uYrZAr/EoLIA6LJGkTIyKGQD/60a
|
|
'';
|
|
|
|
# ssh expands ~ from passwd, so this does not depend on $HOME.
|
|
sshConfig = final.writeText "t3-agent-ssh-config" ''
|
|
Host code.m3ta.dev
|
|
User gitea
|
|
IdentityFile ~/.ssh/m3ta-chiron
|
|
IdentitiesOnly yes
|
|
UserKnownHostsFile ${giteaKnownHosts}
|
|
|
|
# Conditional: IdentityFile accumulates across matching blocks, so a
|
|
# personal code.m3ta.dev entry must not be read for this host.
|
|
Host * !code.m3ta.dev
|
|
Include ~/.ssh/config
|
|
'';
|
|
|
|
wrapperArgs = final.lib.concatStringsSep " " (final.lib.mapAttrsToList (name: value: "--set ${name} ${final.lib.escapeShellArg value}") {
|
|
GIT_AUTHOR_NAME = identity.name;
|
|
GIT_AUTHOR_EMAIL = identity.email;
|
|
GIT_COMMITTER_NAME = identity.name;
|
|
GIT_COMMITTER_EMAIL = identity.email;
|
|
JJ_USER = identity.name;
|
|
JJ_EMAIL = identity.email;
|
|
# bd otherwise falls back to the user's git user.name for its audit trail.
|
|
BEADS_ACTOR = identity.name;
|
|
GIT_SSH_COMMAND = "${final.openssh}/bin/ssh -F ${sshConfig}";
|
|
});
|
|
|
|
wrapT3 = package:
|
|
final.symlinkJoin {
|
|
inherit (package) name meta passthru;
|
|
paths = [package];
|
|
nativeBuildInputs = [final.makeWrapper];
|
|
postBuild = ''
|
|
for program in $out/bin/*; do
|
|
wrapProgram "$program" ${wrapperArgs}
|
|
done
|
|
'';
|
|
};
|
|
in {
|
|
llm-agents =
|
|
prev.llm-agents
|
|
// {
|
|
t3code = wrapT3 prev.llm-agents.t3code;
|
|
t3code-desktop = wrapT3 prev.llm-agents.t3code-desktop;
|
|
};
|
|
};
|
|
|
|
# temp-packages = final: _prev: {
|
|
# temp = import inputs.nixpkgs-9e9486b {
|
|
# system = final.stdenv.hostPlatform.system;
|
|
# config.allowUnfree = true;
|
|
# };
|
|
# };
|
|
|
|
stable-packages = final: _prev: {
|
|
stable = import inputs.nixpkgs-stable {
|
|
system = final.stdenv.hostPlatform.system;
|
|
config.allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
# pinned-packages = final: _prev: {
|
|
# pinned = import inputs.nixpkgs-9472de4 {
|
|
# system = final.stdenv.hostPlatform.system;
|
|
# config.allowUnfree = true;
|
|
# };
|
|
# };
|
|
|
|
# locked-packages = final: _prev: {
|
|
# locked = import inputs.nixpkgs-locked {
|
|
# system = final.stdenv.hostPlatform.system;
|
|
# config.allowUnfree = true;
|
|
# };
|
|
# };
|
|
|
|
master-packages = final: _prev: {
|
|
master = import inputs.nixpkgs-master {
|
|
system = final.stdenv.hostPlatform.system;
|
|
config.allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
# llm-agent packages (qmd, herdr, beads, …) come from
|
|
# inputs.llm-agents.overlays.shared-nixpkgs, applied directly in
|
|
# hosts/common/default.nix. They are consumed via the `pkgs.llm-agents.*`
|
|
# namespace — no flattening to top-level attributes (that clobbered
|
|
# nixpkgs attrs like buildNpmPackage/fetchPnpmDeps and needed a
|
|
# hard-to-maintain blocklist).
|
|
}
|