fix(skills): share deleted-upstream denylist between Nix and rebuild
This commit is contained in:
1 parent
72a23ff0d0
commit
e4c67f0080
8 files changed
+159
-2
No files matched your search
@@ -33,6 +33,13 @@ let
|
||||
rev = "6b0300214a09fd6029cfb7077043125758cd1fd2";
|
||||
hash = "sha256-TDuZ1v+taPdqyvvCs1VHUjtpSy8zHxhQKJv/kIPTpK8=";
|
||||
};
|
||||
# Skills deleted upstream from davidondrej/skills. rebuild.sh reads the same
|
||||
# file to keep these names out of the Skills CLI update. One name per line.
|
||||
deletedSkillNames = lib.pipe (builtins.readFile ./deleted-upstream-skills.txt) [
|
||||
(lib.splitString "\n")
|
||||
(map lib.trim)
|
||||
(builtins.filter (name: name != ""))
|
||||
];
|
||||
in
|
||||
|
||||
{
|
||||
@@ -603,6 +610,39 @@ in
|
||||
echo "pstackSkills: installed ${toString (lib.length pstackSkillNames)} pinned skills into $dest"
|
||||
'';
|
||||
|
||||
# Remove only the skills deleted upstream from davidondrej/skills. The names
|
||||
# come from the source-controlled denylist that rebuild.sh also reads. The
|
||||
# guard below leaves every other skill, the skill lock, house-authored skills,
|
||||
# and the pinned pstack copies alone. Only exact directory or link names in
|
||||
# the agent skill folders used on this Mac are removed.
|
||||
home.activation.removeDeletedUpstreamSkills = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
set -euo pipefail
|
||||
deny_file=${./deleted-upstream-skills.txt}
|
||||
if [ ! -r "$deny_file" ]; then
|
||||
echo "removeDeletedUpstreamSkills: denylist missing at $deny_file" >&2
|
||||
exit 1
|
||||
fi
|
||||
skill_dirs=(
|
||||
"$HOME/.agents/skills"
|
||||
"$HOME/.claude/skills"
|
||||
"$HOME/.config/opencode/skills"
|
||||
"$HOME/.grok/skills"
|
||||
)
|
||||
count=0
|
||||
while IFS= read -r name; do
|
||||
[ -n "$name" ] || continue
|
||||
count=$((count + 1))
|
||||
for dir in "''${skill_dirs[@]}"; do
|
||||
target="$dir/$name"
|
||||
if [ -e "$target" ] || [ -L "$target" ]; then
|
||||
rm -rf -- "$target"
|
||||
echo "removeDeletedUpstreamSkills: removed $target"
|
||||
fi
|
||||
done
|
||||
done < "$deny_file"
|
||||
echo "removeDeletedUpstreamSkills: checked $count deleted skill names"
|
||||
'';
|
||||
|
||||
# OpenSuperWhisper - local voice-first prompting (cask in configuration.nix).
|
||||
# The app reads its model from its own Application Support directory, so the
|
||||
# 1.6 GB Whisper model is downloaded here once and kept outside the Nix store.
|
||||
|
||||
Reference in new issue
Block a user