# Builds a skill source directory into a derivation, `SKILL.md` at the `$out` root. { pkgs, src, name ? builtins.baseNameOf (toString src), }: pkgs.stdenvNoCC.mkDerivation { inherit name src; # A skill is just files to copy, with nothing to unpack, configure, or build. dontUnpack = true; dontConfigure = true; dontBuild = true; installPhase = '' runHook preInstall mkdir -p "$out" cp -R "$src"/. "$out/" test -f "$out/SKILL.md" \ || { echo "mkSkill: skill '${name}' has no SKILL.md at its root" >&2; exit 1; } runHook postInstall ''; # The name as an eval-time attribute, readable without building `$out` # (no import-from-derivation). passthru.skillName = name; }