Compare commits

...
Author SHA1 Message Date
m3ta-chironandClaude Fable 5.1 c9f68a4361 feat(coding/agents): hand the shared MCP catalogue to Claude Code
- Move programs.mcp.servers out of agents.nix into mcp.nix so hosts that
  do not load the whole coding set (T3 Code servers) can import it alone
- Add claude-code.nix: programs.claude-code with enableMcpIntegration,
  replacing the bare llm-agents.claude-code package (would collide on
  bin/claude). home-manager delivers the catalogue as a generated plugin,
  ~/.claude/settings.json and ~/.claude.json stay writable
- ai-memory: register the session-aware Claude bridge via
  programs.claude-code.mcpServers instead of `ai-memory install-mcp`;
  activation only removes the stale user-scope entry now
- Adjust ai-memory.test.sh accordingly

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-10 20:15:24 +01:00
m3ta-chiron b63db50485 Merge branch 'master' of code.m3ta.dev:m3tam3re/m3ta-home 2026-11-05 07:59:10 +01:00
m3ta-chiron 11ddf5e00c Merge branch 'feat/t3code-environment-file' 2026-11-05 07:58:22 +01:00
m3ta-chironandClaude Opus 5.5 2187d9263d feat(t3code): add environmentFile option
Loads an optional KEY=value file (e.g. an agenix secret) as the
service's systemd EnvironmentFile. Store paths are rejected so secrets
cannot end up in the Nix store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 07:48:18 +01:00
m3ta-chiron 4e46e08e4d Merge pull request 'fix(nushell): keep loadSessionVariables off explicitly' (#8) from fix/nushell-session-variables into master 2026-11-03 18:09:08 +01:00
m3ta-chironandClaude Opus 5.5 0c509a7c90 fix(nushell): keep loadSessionVariables off explicitly
home-manager changed the default to true for stateVersion 26.11 and warns
on every host evaluation. Setting the legacy value keeps nushell's
behaviour and silences the warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:09:00 +01:00
m3ta-chiron 38d53d68c0 Merge pull request 'revert: fix(nushell): set loadSessionVariables explicitly' (#7) from revert/nushell-session-variables into master 2026-11-03 16:20:03 +01:00
m3ta-chironandClaude Opus 5.5 6f1826b96b revert: fix(nushell): set loadSessionVariables explicitly
nixos-config's home-manager pin predates the option, so every host failed
to evaluate. Set it again once that pin moves past the default change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:19:57 +01:00
m3ta-chiron e7bbc6275a Merge pull request 'fix(nushell): set loadSessionVariables explicitly' (#6) from fix/nushell-session-variables into master 2026-11-03 16:18:00 +01:00
m3ta-chironandClaude Opus 5.5 6fba804e5f fix(nushell): set loadSessionVariables explicitly
home-manager changed its default and warns on every host evaluation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:16:07 +01:00
m3ta-chiron 2a36d43d9d Merge pull request 'chore(shell): remove Fish configuration' (#5) from chore/remove-fish into master
Reviewed-on: #5
2026-11-02 12:27:44 +01:00
m3ta-chironandClaude Opus 5.5 396c41d99d chore(shell): remove Fish configuration
Nushell is the only interactive shell now. base.shell.fish.enable stays as a
deprecated no-op with a warning, because AZ-NIX-CLIENTS and AZ-NIX-SERVERS
still set it and would otherwise fail to evaluate after a lock update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:23:07 +01:00
19 changed files with 132 additions and 177 deletions

No files matched your search

+1 -2
View File
@@ -142,7 +142,7 @@ If you bring a work NixOS machine into your fleet, you can use the same `m3ta-ho
This gives you:
- Your familiar shell setup (fish, starship, nushell)
- Your familiar shell setup (starship, nushell)
- Your CLI tools (fzf, bat, eza, zoxide, etc.)
- Your editor configs (neovim, zed)
- Work git identity and SSH configuration automatically
@@ -162,7 +162,6 @@ Every module in m3ta-home has an `enable` option. Base modules default to `true`
```
base.cliTools.ansible.enable # Ansible (config rollout to servers)
base.shell.fish.enable # Fish shell
base.shell.nushell.enable # Nushell
base.shell.starship.enable # Starship prompt
base.cliTools.fzf.enable # Fuzzy finder
@@ -35,6 +35,7 @@ Agents committen auf beiden Hosts als `m3ta-chiron`.
| `m3ta.t3code.port` | port | `3773` |
| `m3ta.t3code.interface` | str | `"wt0"` |
| `m3ta.t3code.package` | package | `pkgs.llm-agents.t3code` |
| `m3ta.t3code.environmentFile` | null oder absoluter Pfad außerhalb des Stores | `null` |
Eine Assertion verlangt `services.netbird.enable = true`.
@@ -42,6 +43,7 @@ Eine Assertion verlangt `services.netbird.enable = true`.
- Läuft als `user` mit Gruppe `users`; `HOME` und `WorkingDirectory` kommen aus `config.users.users.<user>.home`.
- `T3CODE_PORT` kommt aus `port`.
- `environmentFile` wird, falls gesetzt, als `EnvironmentFile` geladen (`KEY=value`-Zeilen, z. B. ein agenix-Secret).
- `path` enthält `/etc/profiles/per-user/<user>` und `/run/current-system/sw`.
- `Restart = "on-failure"`, `RestartSec = 5`.
- `bindsTo`, `after` und `wantedBy` zeigen auf `sys-subsystem-net-devices-<interface>.device`.
+15
View File
@@ -52,6 +52,20 @@ in {
defaultText = lib.literalExpression "pkgs.llm-agents.t3code";
description = "T3 Code package.";
};
environmentFile = lib.mkOption {
type = lib.types.nullOr (lib.types.pathWith {
inStore = false;
absolute = true;
});
default = null;
example = "/run/agenix/t3code-env";
description = ''
File with `KEY=value` lines loaded into the server's environment
(systemd `EnvironmentFile`), e.g. tokens for the harnesses. Keep it
outside the Nix store, for example as an agenix secret.
'';
};
};
config = lib.mkIf cfg.enable {
@@ -75,6 +89,7 @@ in {
ExecStart = "${serve}/bin/t3code-serve ${cfg.interface} ${cfg.package}/bin/t3";
Restart = "on-failure";
RestartSec = "5";
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
};
environment = {
+1 -2
View File
@@ -1,4 +1,4 @@
# Carapace — multi-shell completion engine with Fish, Nushell, and Bash integration.
# Carapace — multi-shell completion engine with Nushell and Bash integration.
{
config,
lib,
@@ -13,7 +13,6 @@ in {
config = mkIf cfg.enable {
programs.carapace = {
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
enableBashIntegration = true;
};
-1
View File
@@ -13,7 +13,6 @@ in {
config = mkIf cfg.enable {
programs.eza = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
extraOptions = ["-l" "--icons" "--git" "-a"];
};
-1
View File
@@ -16,7 +16,6 @@ in {
programs.fzf =
{
enable = true;
enableFishIntegration = true;
colors = {
"fg" = "#${config.colorScheme.palette.base05}";
"bg" = "#${config.colorScheme.palette.base00}";
-1
View File
@@ -17,7 +17,6 @@ in {
programs.nix-index = {
enable = true;
enableBashIntegration = true;
enableFishIntegration = true;
enableNushellIntegration = true;
};
};
+1 -2
View File
@@ -1,4 +1,4 @@
# Zoxide — smarter cd with Fish and Nushell integration.
# Zoxide — smarter cd with Nushell integration.
{
config,
lib,
@@ -13,7 +13,6 @@ in {
config = mkIf cfg.enable {
programs.zoxide = {
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
};
};
+1 -1
View File
@@ -1,7 +1,7 @@
# profiles/base/default.nix — Always loaded on every host.
#
# Provides:
# - Shell (nushell, fish, starship) with enable options
# - Shell (nushell, starship) with enable options
# - CLI tools (bat, carapace, direnv, eza, fzf, lf, nitch, television, zellij, zoxide)
# - Secrets management (pass-wayland)
# - Color scheme (dracula)
+1 -1
View File
@@ -1,4 +1,4 @@
# Shell aggregator — imports Nushell (primary), Fish, and Starship prompt.
# Shell aggregator — imports Nushell and Starship prompt.
{...}: {
imports = [
./nushell.nix
+10 -112
View File
@@ -1,118 +1,16 @@
# Fish shell configuration exposed under the new base namespace.
# Deprecated: Fish was removed in favour of Nushell. The option stays as a no-op
# so configs that still set it keep evaluating; delete once none do.
{
config,
lib,
...
}:
with lib; let
cfg = config.base.shell.fish;
in {
# Enabled by default — base modules are always-on.
options.base.shell.fish.enable = (mkEnableOption "enable fish shell") // {default = true;};
config = mkIf cfg.enable {
programs.fish = {
enable = true;
interactiveShellInit = ''
# Fish colors using universal nix-colors palette
# Text colors
set -g fish_color_normal ${config.colorScheme.palette.base05} # text
set -g fish_color_param ${config.colorScheme.palette.base05} # text
set -g fish_color_comment ${config.colorScheme.palette.base03} # muted
set -g fish_color_autosuggestion ${config.colorScheme.palette.base03} # muted
# Command colors
set -g fish_color_command ${config.colorScheme.palette.base0D} # accent6 (blue)
set -g fish_color_quote ${config.colorScheme.palette.base0A} # accent3 (yellow)
set -g fish_color_redirection ${config.colorScheme.palette.base0E} # accent7 (purple)
set -g fish_color_end ${config.colorScheme.palette.base08} # accent1 (red)
set -g fish_color_error ${config.colorScheme.palette.base08} # accent1 (red)
set -g fish_color_operator ${config.colorScheme.palette.base0C} # accent5 (cyan)
set -g fish_color_escape ${config.colorScheme.palette.base09} # accent2 (orange)
# Path colors
set -g fish_color_cwd ${config.colorScheme.palette.base0B} # accent4 (green)
set -g fish_color_cwd_root ${config.colorScheme.palette.base08} # accent1 (red)
set -g fish_color_valid_path --underline
# Interactive colors
set -g fish_color_match ${config.colorScheme.palette.base0B} # accent4 (green)
set -g fish_color_selection --background=${config.colorScheme.palette.base02} # overlay
set -g fish_color_search_match --background=${config.colorScheme.palette.base02} # overlay
set -g fish_color_history_current --bold
set -g fish_color_user ${config.colorScheme.palette.base0B} # accent4 (green)
set -g fish_color_host ${config.colorScheme.palette.base0D} # accent6 (blue)
set -g fish_color_cancel -r
# Pager colors
set -g fish_pager_color_completion normal
set -g fish_pager_color_description ${config.colorScheme.palette.base03} # muted
set -g fish_pager_color_prefix ${config.colorScheme.palette.base0E} # accent7 (purple)
set -g fish_pager_color_progress ${config.colorScheme.palette.base0B} # accent4 (green)
'';
loginShellInit = ''
set -x NIX_PATH nixpkgs=channel:nixos-unstable
set -x NIX_LOG info
set -x WEBKIT_DISABLE_COMPOSITING_MODE 1
set -x TERMINAL ghostty
set -x EDITOR nvim
set -x VISUAL zed
set -x XDG_DATA_HOME $HOME/.local/share
set -x FZF_CTRL_R_OPTS "
--preview='bat --color=always -n {}'
--preview-window up:3:hidden:wrap
--bind 'ctrl-/:toggle-preview'
--bind 'ctrl-y:execute-silent(echo -n {2..} | wl-copy)+abort'
--color header:bold
--header 'Press CTRL-Y to copy command into clipboard'"
set -x FZF_DEFAULT_COMMAND fd --type f --exclude .git --follow --hidden
set -x FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
set -x FLAKE $HOME/p/nixos/nixos-config
source /run/agenix/${config.home.username}-secrets
if test (tty) = "/dev/tty1"
exec uwsm start -F /run/current-system/sw/bin/Hyprland
end
if test (tty) = "/dev/tty2"
exec gamescope -O HDMI-A-1 -W 1920 -H 1080 --adaptive-sync --hdr-enabled --rt --steam -- steam -pipewire-dmabuf -tenfoot
end
'';
shellAbbrs = {
".." = "cd ..";
"..." = "cd ../..";
b = "yazi";
ls = "eza";
l = "eza -l --icons --git -a";
lt = "eza --tree --level=2 --long --icons --git";
grep = "rg";
ps = "procs";
just = "just --unstable";
node = "bun";
npx = "bunx";
fs = "du -ah . | sort -hr | head -n 10";
n = "nix";
nd = "nix develop -c $SHELL";
ns = "nix shell";
nsn = "nix shell nixpkgs#";
nb = "nix build";
nbn = "nix build nixpkgs#";
nf = "nix flake";
nr = "sudo nixos-rebuild --flake .";
nrs = "sudo nixos-rebuild switch --flake .#(uname -n)";
snr = "sudo nixos-rebuild --flake .";
snrs = "sudo nixos-rebuild --flake . switch";
hm = "home-manager --flake .";
hms = "home-manager --flake . switch";
hmr = "cd ~/projects/nix-configurations; nix flake lock --update-input dotfiles; home-manager --flake .#(whoami)@(hostname) switch";
tsu = "sudo tailscale up";
tsd = "sudo tailscale down";
vi = "nvim";
vim = "nvim";
};
};
}: {
options.base.shell.fish.enable = lib.mkOption {
type = lib.types.bool;
default = false;
visible = false;
description = "Deprecated no-op. Fish is no longer configured by m3ta-home.";
};
config.warnings = lib.optional config.base.shell.fish.enable "base.shell.fish.enable has no effect anymore: Fish was removed from m3ta-home. Drop the setting.";
}
+3
View File
@@ -15,6 +15,9 @@ in {
config = mkIf cfg.enable {
programs.nushell = {
enable = true;
# Keep the pre-26.11 behaviour; set explicitly to silence the
# home-manager default-change warning.
loadSessionVariables = false;
envFile.text = ''
$env.config.show_banner = false
$env.NIX_PATH = "nixpkgs=channel:nixos-unstable"
-1
View File
@@ -13,7 +13,6 @@ in {
config = mkIf cfg.enable {
programs.starship = {
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
settings = {
format = "$all$character";
-1
View File
@@ -94,7 +94,6 @@
programs.ghostty = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
settings = {
font-family = "Fira Code";
+4 -40
View File
@@ -18,50 +18,15 @@
};
imports = [
# ai-memory client, skill mirror and OpenCode config
# ai-memory client, skill mirror, shared MCP catalogue, OpenCode and
# Claude Code config
./ai-memory.nix
./claude-skills.nix
./mcp.nix
./opencode.nix
./claude-code.nix
];
programs.mcp = {
enable = true;
servers = {
ContextMode = {
command = "bash";
args = ["-c" "exec bunx context-mode@latest"];
};
DeepWiki = {
url = "https://mcp.deepwiki.com/mcp";
};
Exa = {
command = "bash";
args = ["-c" "EXA_API_KEY=$(cat /run/agenix/exa-key) exec bunx exa-mcp-server@latest tools=web_search_exa"];
};
SallyAI = {
url = "https://app.sally.io/api/v1/McpExternal";
};
Metabase = {
url = "https://kpi.az-gruppe.com/api/metabase-mcp";
};
Outline = {
url = "https://wiki.az-gruppe.com/mcp";
};
Playwright = {
command = "bash";
args = ["-c" "exec bunx @playwright/mcp@latest"];
};
Ref = {
command = "bash";
args = ["-c" "REF_API_KEY=$(cat /run/agenix/ref-key) exec bunx ref-tools-mcp@latest"];
};
Teams = {
command = "bunx";
args = ["-y" "@floriscornel/teams-mcp@latest"];
};
};
};
# NOTE: llm-agent packages are consumed via the `llm-agents` namespace
# (pkgs.llm-agents.*), provided by numtide/llm-agents.nix's
# `overlays.shared-nixpkgs`. The consumer's nixos-config MUST apply that
@@ -72,7 +37,6 @@
agent-lib
llm-agents.agent-browser
llm-agents.beads
llm-agents.claude-code
llm-agents.claude-desktop
crunch
docker-sbx
+21 -11
View File
@@ -3,12 +3,13 @@
# The server runs on m3-hermes (nixos-config) and is reached at
# memory.m3ta.dev; no server runs on clients. Hybrid setup:
# - Nix owns the package, the client config (server URL + bearer token
# file), the OpenCode MCP entry (via programs.mcp, since opencode.json
# is a home-manager symlink) and the scope markers (~/.ai-memory.toml
# plus one marker per workspace directory).
# - Activation runs ai-memory's own installers for the lifecycle hooks,
# the session-aware Claude Code MCP entry and the skills, so generated
# files always match the installed ai-memory version.
# file), the MCP entries (programs.mcp for OpenCode, and a session-aware
# override in programs.claude-code.mcpServers for Claude Code, both
# delivered through the agents' enableMcpIntegration) and the scope
# markers (~/.ai-memory.toml plus one marker per workspace directory).
# - Activation runs ai-memory's own installers for the lifecycle hooks and
# the skills, so generated files always match the installed ai-memory
# version.
#
# The bearer token (an `aim_` API key, one per host) is an agenix secret the
# host repo provides at `tokenFile`. It is never copied into a generated
@@ -100,6 +101,18 @@ in {
args = ["mcp-bridge" "--no-session-id" "--server-url" "${cfg.serverUrl}/mcp"];
};
# Claude Code gets the same server name through
# programs.claude-code.enableMcpIntegration, but session-aware: the stdio
# bridge forwards the lifecycle-hook session id and reads the token file
# itself. (A plain HTTP entry carries no credentials, and Claude Code then
# tries OAuth client registration, which ai-memory does not offer.)
# Claude Code's own mcpServers take precedence over the shared entry, so
# this is one server, not two.
programs.claude-code.mcpServers.ai-memory = mkIf (elem "claude-code" cfg.agents) {
command = exe;
args = ["mcp-bridge" "--server-url" "${cfg.serverUrl}/mcp"];
};
home.file =
{
# Client config: `ai-memory hook`, `mcp-bridge` and the installers
@@ -130,13 +143,10 @@ in {
'')
cfg.agents}
${optionalString (elem "claude-code" cfg.agents) ''
# The MCP entry now comes from programs.claude-code (see above);
# drop the user-scope entry earlier versions wrote into ~/.claude.json.
export PATH="${pkgs.llm-agents.claude-code}/bin:$PATH"
run claude mcp remove ai-memory -s user >/dev/null 2>&1 || true
# --session-aware: stdio bridge that reads the token file itself. A
# plain HTTP entry carries no credentials, and Claude Code then tries
# OAuth client registration, which ai-memory does not offer.
run ${exe} install-mcp --client claude-code --apply --session-aware \
--server-url ${escapeShellArg "${cfg.serverUrl}/mcp"}
''}
# Into ~/.agents/skills; claude-skills-sync mirrors them to Claude.
run ${exe} install-skills --scope global --agent agents
@@ -51,7 +51,12 @@ check "hooks opencode2" "$act" "install-hooks --agent opencode2 --apply"
check "auth-token symlink" "$act" "ln -sfn /run/agenix/ai-memory-token "
refute "no token on command lines" "$act" "--auth-token"
refute "activation must not write opencode.json (home-manager symlink)" "$act" "install-mcp --client opencode"
check "claude mcp is the session-aware bridge" "$act" "install-mcp --client claude-code --apply --session-aware"
refute "activation no longer registers the claude mcp itself" "$act" "install-mcp --client claude-code"
check "stale user-scope claude entry is removed" "$act" "claude mcp remove ai-memory -s user"
claude="$(ev programs.claude-code.mcpServers.ai-memory.args --apply 'builtins.concatStringsSep " "')"
check "claude mcp is the session-aware bridge" "$claude" "mcp-bridge --server-url https://memory.m3ta.dev/mcp"
refute "claude mcp forwards the session id" "$claude" "--no-session-id"
# Missing token file: skip with a warning, exit 0, never call ai-memory.
script="$(printf '%s\n' "$act" | sed 's|/run/agenix/ai-memory-token|/nonexistent/ai-memory-token|g')"
@@ -0,0 +1,20 @@
# Claude Code via home-manager `programs.claude-code`.
#
# enableMcpIntegration hands the shared programs.mcp catalogue (mcp.nix) to
# Claude Code the same way opencode.nix does for OpenCode: home-manager
# generates a plugin carrying .mcp.json and registers it (as a personal plugin
# under ~/.claude/skills/claude-code-home-manager on home-manager master, via a
# `--plugin-dir` wrapper on release-26.05). Nothing in ~/.claude is turned
# into a store symlink: settings.json (ai-memory hooks, plugins, theme) and
# ~/.claude.json (logins) stay writable for Claude Code itself.
#
# Do NOT add llm-agents.claude-code to home.packages next to this module;
# programs.claude-code installs its (possibly wrapped) package and a second
# `claude` would collide in the profile.
{pkgs, ...}: {
programs.claude-code = {
enable = true;
package = pkgs.llm-agents.claude-code;
enableMcpIntegration = true;
};
}
+46
View File
@@ -0,0 +1,46 @@
# Shared MCP server catalogue (home-manager `programs.mcp`).
#
# Single source for every agent that integrates with programs.mcp:
# OpenCode (opencode.nix, enableMcpIntegration) and Claude Code
# (claude-code.nix, enableMcpIntegration). ai-memory adds its own entry in
# ai-memory.nix. Hosts that do not load the whole coding set (servers running
# T3 Code) import this file directly.
{...}: {
programs.mcp = {
enable = true;
servers = {
ContextMode = {
command = "bash";
args = ["-c" "exec bunx context-mode@latest"];
};
DeepWiki = {
url = "https://mcp.deepwiki.com/mcp";
};
Exa = {
command = "bash";
args = ["-c" "EXA_API_KEY=$(cat /run/agenix/exa-key) exec bunx exa-mcp-server@latest tools=web_search_exa"];
};
SallyAI = {
url = "https://app.sally.io/api/v1/McpExternal";
};
Metabase = {
url = "https://kpi.az-gruppe.com/api/metabase-mcp";
};
Outline = {
url = "https://wiki.az-gruppe.com/mcp";
};
Playwright = {
command = "bash";
args = ["-c" "exec bunx @playwright/mcp@latest"];
};
Ref = {
command = "bash";
args = ["-c" "REF_API_KEY=$(cat /run/agenix/ref-key) exec bunx ref-tools-mcp@latest"];
};
Teams = {
command = "bunx";
args = ["-y" "@floriscornel/teams-mcp@latest"];
};
};
};
}