chore: update flake, agents lib, and clean up tracked dotfiles
Some checks failed
Update Nix Packages with nix-update / nix-update (push) Failing after 3m59s
Some checks failed
Update Nix Packages with nix-update / nix-update (push) Failing after 3m59s
- Remove .pi* and .td-root files from git index (now in .gitignore) - Update flake.lock and flake.nix - Add shells/coding.nix, remove shells/opencode.nix - Update lib/agents.nix, lib/coding-rules.nix - Update modules/home-manager/coding/agents/pi.nix - Update tests for agents and coding-rules - Update .gitignore
This commit is contained in:
@@ -44,6 +44,60 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
codingRules = mkOption {
|
||||
type = types.nullOr (types.submodule {
|
||||
options = {
|
||||
languages = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
description = ''
|
||||
Language-specific coding rules to include
|
||||
(e.g. [ "python" "typescript" "nix" ]).
|
||||
Rule files are read from the AGENTS repo's rules/languages/ directory.
|
||||
'';
|
||||
};
|
||||
|
||||
concerns = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"coding-style"
|
||||
"naming"
|
||||
"documentation"
|
||||
"testing"
|
||||
"git-workflow"
|
||||
"project-structure"
|
||||
];
|
||||
description = ''
|
||||
Concern rules to include from the AGENTS repo's rules/concerns/ directory.
|
||||
'';
|
||||
};
|
||||
|
||||
frameworks = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
description = ''
|
||||
Framework-specific coding rules to include
|
||||
(e.g. [ "react" "fastapi" ]).
|
||||
Rule files are read from the AGENTS repo's rules/frameworks/ directory.
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
default = null;
|
||||
description = ''
|
||||
Coding rules to inject into ~/.pi/agent/AGENTS.md.
|
||||
Rules are read from the AGENTS repository and appended as markdown sections.
|
||||
Requires agentsInput to be set.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
{
|
||||
languages = [ "python" "typescript" ];
|
||||
concerns = [ "coding-style" "testing" ];
|
||||
frameworks = [ "fastapi" ];
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.submodule {
|
||||
freeformType = types.attrsOf types.anything;
|
||||
@@ -166,6 +220,12 @@ in
|
||||
|
||||
piSettings = filterNulls cfg.settings;
|
||||
|
||||
# Coding rules config for renderForPi (only when both agentsInput and codingRules are set)
|
||||
piCodingRules =
|
||||
if cfg.agentsInput != null && cfg.codingRules != null
|
||||
then cfg.codingRules // { agents = cfg.agentsInput; }
|
||||
else null;
|
||||
|
||||
# Rendered agents (only computed when agentsInput is set)
|
||||
rendered =
|
||||
if cfg.agentsInput != null
|
||||
@@ -175,6 +235,7 @@ in
|
||||
canonical = cfg.agentsInput.lib.loadAgents;
|
||||
modelOverrides = cfg.modelOverrides;
|
||||
primaryAgent = cfg.primaryAgent;
|
||||
codingRules = piCodingRules;
|
||||
}
|
||||
else null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user