···139139 '';
140140 };
141141142142+ plugins = lib.mkOption {
143143+ type = lib.types.listOf lib.types.path;
144144+ default = [ ];
145145+ example = lib.literalExpression ''
146146+ [
147147+ # A fetched plugin from GitHub:
148148+ (pkgs.fetchFromGitHub {
149149+ owner = "Myr-Aya";
150150+ repo = "GouvernAI-claude-code-plugin";
151151+ rev = "main";
152152+ hash = "sha256-AAAA...";
153153+ # The plugin directory is a subdirectory of the repo:
154154+ } + "/gouvernai")
155155+156156+ # A local plugin directory (must contain .claude-plugin/plugin.json):
157157+ ./my-local-plugin
158158+159159+ # A plugin built by a Nix derivation:
160160+ my-plugin-package
161161+ ]
162162+ '';
163163+ description = ''
164164+ Additional Claude Code plugin directories to load. Each entry
165165+ must be a path to a directory containing `.claude-plugin/plugin.json`.
166166+ Passed as extra `--plugin-dir` flags alongside the bundled plugin.
167167+168168+ Plugins can provide skills, commands, agents, and hooks. Use this
169169+ to declaratively install third-party plugins (e.g. from GitHub)
170170+ or locally developed ones without going through the Claude Code
171171+ marketplace.
172172+ '';
173173+ };
174174+142175 mcpServers = lib.mkOption {
143176 type = jsonFormat.type;
144177 default = { };
···269302 # Always inject our plugin dir + settings file into every invocation.
270303 # `--plugin-dir` is repeatable so users can still pass more on the CLI.
271304 config.flags."--plugin-dir" = {
272272- value = [ "${pluginDir}" ];
305305+ value = [ "${pluginDir}" ] ++ map toString config.plugins;
273306 order = 100;
274307 };
275308 config.flags."--settings" = {