claude-code: mark hook scripts executable

Inline hooks are scripts, so write them with the executable bit set. Add NMT assertions covering default and custom config directories.
This commit is contained in:
Austin Horstman
2026-06-01 15:12:42 -05:00
parent 5a608a621b
commit d0af9b8bf3
3 changed files with 11 additions and 4 deletions

View File

@@ -558,10 +558,14 @@ in
name: content: nameValuePair "${cfg.configDir}/${subdir}/${name}.md" (mkSourceEntry content)
) attrs;
mkTextEntries =
subdir: attrs:
mkHookEntries =
attrs:
lib.mapAttrs' (
name: content: nameValuePair "${cfg.configDir}/${subdir}/${name}" { text = content; }
name: content:
nameValuePair "${cfg.configDir}/hooks/${name}" {
text = content;
executable = true;
}
) attrs;
mkRecursiveDirAttrs =
@@ -727,7 +731,7 @@ in
recursive = true;
};
})
(mkTextEntries "hooks" cfg.hooks)
(mkHookEntries cfg.hooks)
(lib.optionalAttrs (builtins.isAttrs cfg.skills) (lib.mapAttrs' mkSkillEntry cfg.skills))
(mkMarkdownEntries "output-styles" cfg.outputStyles)
];