From 8a739e92be66d1a5d0c15d18627b817e627929a9 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 17:30:06 -0400 Subject: [PATCH] docs(nix-style): require executable helpers --- src/skills/style/nix/rules/general.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/skills/style/nix/rules/general.md b/src/skills/style/nix/rules/general.md index e0d0a58..3a052b8 100644 --- a/src/skills/style/nix/rules/general.md +++ b/src/skills/style/nix/rules/general.md @@ -21,3 +21,18 @@ Do not call `lib.removeSuffix ".nix"` outside the utility definition. ### Rationale The utility centralizes Nix file-name normalization. + +## Use executable helpers for package commands + +### Rule + +Use `lib.getExe` when invoking a package's main executable. +Use `lib.getExe'` when invoking a non-main executable from a package. +Do not build executable paths with `"${pkg}/bin/name"` when an executable helper can name the target. +Use `lib.getExe' config.programs..package "tool"` when a command must follow a configured package option. + +### Rationale + +Executable helpers use the package output that contains binaries. +They also make package ownership explicit. +`lib.getExe'` avoids accidentally resolving a package's main executable when code needs a different tool.