manual: update meta-attributes section
Promote the `maintainers = with maintainers; [ ]` syntax as that is most common in nixpkgs, and remove the `nix-env` example which doesn't work like that anymore.
This commit is contained in:
parent
e76c78d206
commit
cfdd900d66
1 changed files with 2 additions and 48 deletions
|
@ -11,58 +11,12 @@ meta = with lib; {
|
|||
'';
|
||||
homepage = "https://www.gnu.org/software/hello/manual/";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = [ maintainers.eelco ];
|
||||
maintainers = with maintainers; [ eelco ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
```
|
||||
|
||||
Meta-attributes are not passed to the builder of the package. Thus, a change to a meta-attribute doesn’t trigger a recompilation of the package. The value of a meta-attribute must be a string.
|
||||
|
||||
The meta-attributes of a package can be queried from the command-line using `nix-env`:
|
||||
|
||||
```ShellSession
|
||||
$ nix-env -qa hello --json
|
||||
{
|
||||
"hello": {
|
||||
"meta": {
|
||||
"description": "A program that produces a familiar, friendly greeting",
|
||||
"homepage": "https://www.gnu.org/software/hello/manual/",
|
||||
"license": {
|
||||
"fullName": "GNU General Public License version 3 or later",
|
||||
"shortName": "GPLv3+",
|
||||
"url": "http://www.fsf.org/licensing/licenses/gpl.html"
|
||||
},
|
||||
"longDescription": "GNU Hello is a program that prints \"Hello, world!\" when you run it.\nIt is fully customizable.\n",
|
||||
"maintainers": [
|
||||
"Ludovic Court\u00e8s <ludo@gnu.org>"
|
||||
],
|
||||
"platforms": [
|
||||
"i686-linux",
|
||||
"x86_64-linux",
|
||||
"armv5tel-linux",
|
||||
"armv7l-linux",
|
||||
"mips32-linux",
|
||||
"x86_64-darwin",
|
||||
"i686-cygwin",
|
||||
"i686-freebsd13",
|
||||
"x86_64-freebsd13",
|
||||
"i686-openbsd",
|
||||
"x86_64-openbsd"
|
||||
],
|
||||
"position": "/home/user/dev/nixpkgs/pkgs/applications/misc/hello/default.nix:14"
|
||||
},
|
||||
"name": "hello-2.9",
|
||||
"system": "x86_64-linux"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`nix-env` knows about the `description` field specifically:
|
||||
|
||||
```ShellSession
|
||||
$ nix-env -qa hello --description
|
||||
hello-2.3 A program that produces a familiar, friendly greeting
|
||||
```
|
||||
Meta-attributes are not passed to the builder of the package. Thus, a change to a meta-attribute doesn’t trigger a recompilation of the package.
|
||||
|
||||
## Standard meta-attributes {#sec-standard-meta-attributes}
|
||||
|
||||
|
|
Loading…
Reference in a new issue