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:
m3tm3re
2026-04-26 11:17:03 +02:00
parent 73bd2b1f2e
commit 797ffb2b8a
5 changed files with 16 additions and 105 deletions

View File

@@ -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)} ]";
}
];
};
}