From 0a612d515c443a03f7deb4921d26f3c82bfb31cb Mon Sep 17 00:00:00 2001 From: kaynetik Date: Tue, 11 Aug 2026 09:00:21 +0200 Subject: [PATCH 1/3] hunk: move skills to `$out/share/skills/hunk/` Follow the layout agreed in NixOS/nixpkgs#547426 and drop the `$out/skills` symlink. Patch `paths.ts`` so `hunk skill path` still resolves the bundled skill from the share tree. Signed-off-by: kaynetik --- pkgs/by-name/hu/hunk/package.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hu/hunk/package.nix b/pkgs/by-name/hu/hunk/package.nix index d3a07d79ee59..b92f83f738a7 100644 --- a/pkgs/by-name/hu/hunk/package.nix +++ b/pkgs/by-name/hu/hunk/package.nix @@ -71,6 +71,16 @@ stdenv.mkDerivation { writableTmpDirAsHomeHook ]; + # Teach `hunk skill path` to find the FHS layout under share/skills/$pname + # (https://github.com/NixOS/nixpkgs/issues/547426) instead of $out/skills. + postPatch = '' + substituteInPlace src/core/paths.ts \ + --replace-fail \ + 'join("node_modules", "hunkdiff", HUNK_REVIEW_SKILL_RELATIVE_PATH),' \ + 'join("node_modules", "hunkdiff", HUNK_REVIEW_SKILL_RELATIVE_PATH), + join("share", "skills", "${pname}", "hunk-review", "SKILL.md"),' + ''; + configurePhase = '' runHook preConfigure @@ -100,9 +110,8 @@ stdenv.mkDerivation { runHook preInstall install -Dm755 hunk $out/bin/hunk - mkdir -p $out/share/hunk - cp -R skills $out/share/hunk/skills - ln -s share/hunk/skills $out/skills + mkdir -p $out/share/skills + cp -R skills $out/share/skills/$pname runHook postInstall ''; @@ -121,6 +130,7 @@ stdenv.mkDerivation { runHook preInstallCheck $out/bin/hunk --version | grep -F ${version} + test -f $out/share/skills/$pname/hunk-review/SKILL.md test -f "$($out/bin/hunk skill path)" runHook postInstallCheck From bec4e712b2fdf4c136ec28f0e0a5b7c093ada190 Mon Sep 17 00:00:00 2001 From: kaynetik Date: Tue, 11 Aug 2026 11:11:03 +0200 Subject: [PATCH 2/3] hunk: drop redundant skill install-check Signed-off-by: kaynetik --- pkgs/by-name/hu/hunk/package.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hu/hunk/package.nix b/pkgs/by-name/hu/hunk/package.nix index b92f83f738a7..93035361efc0 100644 --- a/pkgs/by-name/hu/hunk/package.nix +++ b/pkgs/by-name/hu/hunk/package.nix @@ -110,8 +110,8 @@ stdenv.mkDerivation { runHook preInstall install -Dm755 hunk $out/bin/hunk - mkdir -p $out/share/skills - cp -R skills $out/share/skills/$pname + mkdir -p $out/share/skills/$pname/hunk-review + cp skills/hunk-review/SKILL.md $out/share/skills/$pname/hunk-review/SKILL.md runHook postInstall ''; @@ -130,7 +130,6 @@ stdenv.mkDerivation { runHook preInstallCheck $out/bin/hunk --version | grep -F ${version} - test -f $out/share/skills/$pname/hunk-review/SKILL.md test -f "$($out/bin/hunk skill path)" runHook postInstallCheck From 89a98a8f7a81aba98ab96ce5e809504ba6d7a1ad Mon Sep 17 00:00:00 2001 From: Yohann Boniface Date: Wed, 12 Aug 2026 23:58:11 +0200 Subject: [PATCH 3/3] hunk: inline use of pname Co-authored-by: Ethan Carter Edwards --- pkgs/by-name/hu/hunk/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hu/hunk/package.nix b/pkgs/by-name/hu/hunk/package.nix index 93035361efc0..51ce4609c060 100644 --- a/pkgs/by-name/hu/hunk/package.nix +++ b/pkgs/by-name/hu/hunk/package.nix @@ -78,7 +78,7 @@ stdenv.mkDerivation { --replace-fail \ 'join("node_modules", "hunkdiff", HUNK_REVIEW_SKILL_RELATIVE_PATH),' \ 'join("node_modules", "hunkdiff", HUNK_REVIEW_SKILL_RELATIVE_PATH), - join("share", "skills", "${pname}", "hunk-review", "SKILL.md"),' + join("share", "skills", "hunk", "hunk-review", "SKILL.md"),' ''; configurePhase = '' @@ -110,8 +110,8 @@ stdenv.mkDerivation { runHook preInstall install -Dm755 hunk $out/bin/hunk - mkdir -p $out/share/skills/$pname/hunk-review - cp skills/hunk-review/SKILL.md $out/share/skills/$pname/hunk-review/SKILL.md + mkdir -p $out/share/skills/hunk/hunk-review + cp skills/hunk-review/SKILL.md $out/share/skills/hunk/hunk-review/SKILL.md runHook postInstall '';