diff options
Diffstat (limited to 'nixpkgs/pkgs/README.md')
-rw-r--r-- | nixpkgs/pkgs/README.md | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/README.md b/nixpkgs/pkgs/README.md index f614f1f72976..0269264ed553 100644 --- a/nixpkgs/pkgs/README.md +++ b/nixpkgs/pkgs/README.md @@ -348,7 +348,7 @@ There are a few naming guidelines: - The `pname` and the `version` attribute _must not_ contain uppercase letters — e.g., `"mplayer" instead of `"MPlayer"`. -- The `version` attribute _must_ start with a digit e.g`"0.3.1rc2". +- The `version` attribute _must_ start with a digit e.g., `"0.3.1rc2"`. - If a package is a commit from a repository without a version assigned, then the `version` attribute _should_ be the latest upstream version preceding that commit, followed by `-unstable-` and the date of the (fetched) commit. The date _must_ be in `"YYYY-MM-DD"` format. @@ -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). |