fix: assert unknown profiles in mkHomeConfig; move agent modules to coding/agents
- home/lib/default.nix: add assertion for unknown profile names instead of
silently filtering them out; remove unused 'inherit (lib) optional'
- home/coding/agents/{opencode,pi}.nix: moved from home/features/coding/
to co-locate with agents.nix (eliminating cross-directory back-references)
- home/coding/agents/agents.nix: update imports to ./opencode.nix and ./pi.nix
- home/features/coding/: remove now-dead default.nix (nothing imported it)
This commit is contained in:
@@ -19,8 +19,8 @@ in {
|
||||
|
||||
imports = [
|
||||
# OpenCode and Pi agent configurations
|
||||
../../features/coding/opencode.nix
|
||||
../../features/coding/pi.nix
|
||||
./opencode.nix
|
||||
./pi.nix
|
||||
];
|
||||
|
||||
coding.agents.skills = {
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
videoDrivers,
|
||||
...
|
||||
}: let
|
||||
npmGlobalPrefix = "${config.home.homeDirectory}/.npm-global";
|
||||
in {
|
||||
home.file.".npmrc".text = ''
|
||||
prefix=${npmGlobalPrefix}
|
||||
'';
|
||||
home.sessionVariables.NPM_CONFIG_PREFIX = npmGlobalPrefix;
|
||||
imports = [
|
||||
./opencode.nix
|
||||
./pi.nix
|
||||
];
|
||||
|
||||
coding.agents.skills = {
|
||||
agentsInput = inputs.agents;
|
||||
externalSkills = [
|
||||
{
|
||||
src = inputs.skills-anthropic;
|
||||
selectSkills = ["pdf" "docx" "frontend-design"];
|
||||
}
|
||||
{src = inputs.skills-vercel;}
|
||||
{src = inputs.skills-basecamp;}
|
||||
{src = inputs.skills-kestra;}
|
||||
];
|
||||
};
|
||||
|
||||
programs.mcp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
DeepWiki = {
|
||||
url = "https://mcp.deepwiki.com/mcp";
|
||||
};
|
||||
Ref = {
|
||||
command = "bash";
|
||||
args = ["-c" "REF_API_KEY=$(cat /run/agenix/ref-key) exec bunx ref-tools-mcp@latest"];
|
||||
};
|
||||
Exa = {
|
||||
command = "bash";
|
||||
args = ["-c" "EXA_API_KEY=$(cat /run/agenix/exa-key) exec bunx exa-mcp-server@latest tools=web_search_exa"];
|
||||
};
|
||||
Outline = {
|
||||
url = "https://wiki.az-gruppe.com/mcp";
|
||||
};
|
||||
ContextMode = {
|
||||
command = "bash";
|
||||
args = ["-c" "exec bunx context-mode@latest"];
|
||||
};
|
||||
Honcho = {
|
||||
command = "bash";
|
||||
args = [
|
||||
"-c"
|
||||
''exec bunx mcp-remote@latest https://mcp.honcho.dev --header "Authorization:Bearer $(cat /run/agenix/honcho-key)" --header "X-Honcho-User-Name:m3tam3re"''
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
agenix-cli
|
||||
agent-browser
|
||||
alejandra
|
||||
bc
|
||||
bun
|
||||
devpod
|
||||
#devpod-desktop
|
||||
gnumake
|
||||
cmake
|
||||
(python3.withPackages (ps:
|
||||
with ps; [
|
||||
pip
|
||||
uv
|
||||
# Scientific packages
|
||||
numba
|
||||
numpy
|
||||
torch
|
||||
srt
|
||||
]))
|
||||
pyrefly
|
||||
nixd
|
||||
nix-update
|
||||
nodejs
|
||||
# opencode-desktop
|
||||
(qmd.override {
|
||||
vulkanSupport = videoDrivers == ["amdgpu"];
|
||||
cudaSupport = videoDrivers == ["nvidia"];
|
||||
})
|
||||
openshell
|
||||
openspec
|
||||
pi-coding-agent
|
||||
alejandra
|
||||
sidecar
|
||||
tailwindcss
|
||||
tailwindcss-language-server
|
||||
td
|
||||
];
|
||||
}
|
||||
@@ -11,8 +11,6 @@
|
||||
{ lib }:
|
||||
|
||||
let
|
||||
inherit (lib) optional;
|
||||
|
||||
# Infrastructure layer — nixpkgs overlays, nix-colors, m3ta-nixpkgs modules.
|
||||
# Always loaded on every host.
|
||||
commonModule = ../common;
|
||||
@@ -55,6 +53,12 @@ in {
|
||||
else if context == "server" then [ contextModuleMap.server ]
|
||||
else [];
|
||||
|
||||
# Partition profiles into known and unknown for assertion + safe import.
|
||||
unknownProfiles = builtins.filter
|
||||
(profileName: ! builtins.hasAttr profileName profileModuleMap)
|
||||
profiles;
|
||||
|
||||
# Only import known profiles; the assertion below catches unknowns.
|
||||
activeProfiles = builtins.filter
|
||||
(profileName: builtins.hasAttr profileName profileModuleMap)
|
||||
profiles;
|
||||
@@ -76,6 +80,14 @@ in {
|
||||
"m3ta home: context must be 'desktop', 'server', or null"
|
||||
+ " (got: '${contextStr}')";
|
||||
}
|
||||
{
|
||||
assertion = unknownProfiles == [];
|
||||
message =
|
||||
"m3ta home: unknown profiles requested:"
|
||||
+ " [ ${builtins.concatStringsSep " " unknownProfiles} ]."
|
||||
+ " Valid profiles are:"
|
||||
+ " [ ${builtins.concatStringsSep " " (builtins.attrNames profileModuleMap)} ]";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user