Unverified Commit 6e5e3396 authored by éclairevoyant's avatar éclairevoyant
Browse files

pkgs/README.md: clarify guidelines for `meta.mainProgram`

parent efbacad2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -384,7 +384,13 @@ All versions of a package _must_ be included in `all-packages.nix` to make sure
* `meta.license` must be set and match the upstream license.
  * If there is no upstream license, `meta.license` should default to `lib.licenses.unfree`.
  * If in doubt, try to contact the upstream developers for clarification.
* `meta.mainProgram` must be set when appropriate.
* `meta.mainProgram` must be set to the name of the executable which facilitates the primary function or purpose of the package, if there is such an executable in `$bin/bin/` (or `$out/bin/`, if there is no `"bin"` output).
  * Packages that only have a single executable in the applicable directory above should set `meta.mainProgram`. For example, the package `ripgrep` only has a single executable `rg` under `$out/bin/`, so `ripgrep.meta.mainProgram` is set to `"rg"`.
  * Packages like `polkit_gnome` that have no executables in the applicable directory should not set `meta.mainProgram`.
  * Packages like `e2fsprogs` that have multiple executables, none of which can be considered the main program, should not set `meta.mainProgram`.
  * Packages which are not primarily used for a single executable do not need to set `meta.mainProgram`.
  * Always prefer using a hardcoded string (don't use `pname`, for example).
  * When in doubt, ask for reviewer input.
* `meta.maintainers` must be set for new packages.

See the Nixpkgs manual for more details on [standard meta-attributes](https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes).