| 1 | { |
| 2 | lib, |
| 3 | runCommand, |
| 4 | writeText, |
| 5 | roundabout, |
| 6 | }: |
| 7 | |
| 8 | let |
| 9 | hooks = writeText "hooks.json" ( |
| 10 | builtins.toJSON { |
| 11 | hooks = import ./hooks.nix { inherit lib roundabout; }; |
| 12 | } |
| 13 | ); |
| 14 | plugin = writeText "plugin.json" ( |
| 15 | builtins.toJSON { |
| 16 | name = "roundabout"; |
| 17 | description = "builds wait their turn"; |
| 18 | version = roundabout.version; |
| 19 | author.name = "atagen"; |
| 20 | } |
| 21 | ); |
| 22 | marketplace = writeText "marketplace.json" ( |
| 23 | builtins.toJSON { |
| 24 | name = "roundabout"; |
| 25 | owner.name = "atagen"; |
| 26 | description = "one build at a time, please"; |
| 27 | plugins = [ |
| 28 | { |
| 29 | name = "roundabout"; |
| 30 | source = "./plugins/roundabout"; |
| 31 | } |
| 32 | ]; |
| 33 | } |
| 34 | ); |
| 35 | in |
| 36 | # a marketplace wrapping one plugin, since claude code won't install a bare |
| 37 | # plugin dir. `claude plugin marketplace add <this>` then install roundabout@roundabout |
| 38 | runCommand "roundabout-plugin-${roundabout.version}" { } '' |
| 39 | p=$out/plugins/roundabout |
| 40 | mkdir -p $out/.claude-plugin $p/.claude-plugin $p/hooks $p/skills $p/bin |
| 41 | cp ${marketplace} $out/.claude-plugin/marketplace.json |
| 42 | cp ${plugin} $p/.claude-plugin/plugin.json |
| 43 | cp ${hooks} $p/hooks/hooks.json |
| 44 | cp -r ${../plugin/skills}/. $p/skills/ |
| 45 | ln -s ${lib.getExe roundabout} $p/bin/rabt |
| 46 | '' |