docs(nix-style): require executable helpers

This commit is contained in:
2026-10-11 17:30:06 -04:00
parent 2651e8fec6
commit 8a739e92be

View File

@@ -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.<name>.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.