From cfdd900d66a39636851ba61e821b70fba94a7b62 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sat, 3 Dec 2022 10:04:15 +0000 Subject: 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. --- doc/stdenv/meta.chapter.md | 50 ++-------------------------------------------- 1 file changed, 2 insertions(+), 48 deletions(-) (limited to 'doc') diff --git a/doc/stdenv/meta.chapter.md b/doc/stdenv/meta.chapter.md index f4d8ed2919dd..46114dacb458 100644 --- a/doc/stdenv/meta.chapter.md +++ b/doc/stdenv/meta.chapter.md @@ -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 " - ], - "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} -- cgit 1.4.1