Commit Graph

69 Commits

Author SHA1 Message Date
David Chocholatý
c4705f766a doc: Fix URL for file licenses.nix 2026-05-30 19:04:49 +02:00
Philip Taron
f454526a40 requireFile: set unfree license by default (#515536) 2026-05-28 00:06:54 +00:00
Tom Hunze
009aa0c916 doc: clarify effect of meta.hydraPlatforms on reverse dependencies 2026-05-27 15:02:42 +02:00
Ethan Carter Edwards
9d2f2d71e4 doc: add meta.donationPage
This might be a nice way to use our reach to remind users to donate to
FLOSS projects that they use and love.

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
2026-05-27 00:36:21 -07:00
Hans Joachim Kliemeck
8478c2384b stdenv: Package URL (PURL) metadata fields 2026-05-26 21:47:54 +02:00
Samuel Dionne-Riel
95584fa133 doc/meta: Drop incorrect cpePatchVersionInUpdateWithVendor
See the previous commit for the explanation as to why this is an invalid
value. See the follow-up commits for the complete removal of the
helpers.
2026-04-08 16:18:27 -04:00
Samuel Dionne-Riel
8b81adddcd doc/meta: Fix documentation and example for update CPE field
The previous claims are unsourced, since they are not supported by the
source given for CPEs.

Quoting from the 5.3.3.5 section of the NISTIR 7695 document:

> Values for this attribute SHOULD be vendor-specific alphanumeric
> strings characterizing the particular update, service pack, or
> point release of the product.

So, first, they should be ***vendor-specific***, and dare I say,
vendor-specified. But let's not trip on the carpet's flower pattern, and
instead look at evidence from data.

Using the data from `official-cpe-dictionary_v2.3.xml`, gently massaged
into a form that can be queried, we can list all known CPE expressions
for glibc.

There is only one known entry using the `update` field. It's:

```
cpe:2.3:a:gnu:glibc:2.0.5🅱️*:*:*:*:*:*
```

As such, the current example is plainly and demonstrably wrong.

```
SELECT * FROM cpe
WHERE cpe_update != ''
   AND cpe_vendor = 'gnu'
   AND cpe_product = 'glibc'
ORDER BY cpe_vendor, cpe_product, cpe_version

id    |title            |cpe_part|cpe_vendor|cpe_product|cpe_version|cpe_update|cpe_edition|cpe_language|cpe_sw_edition|cpe_target_sw|cpe_target_hw|cpe_other|
------+-----------------+--------+----------+-----------+-----------+----------+-----------+------------+--------------+-------------+-------------+---------+
460867|GNU glibc 2.0.5 B|a       |gnu       |glibc      |2.0.5      |b         |           |            |              |             |             |         |
```

Let's see good examples of `cpe_product` in contrast:

```
SELECT * FROM cpe
WHERE cpe_update != ''
   AND cpe_vendor = 'gnu'
   AND cpe_product = 'bash'
ORDER BY cpe_vendor, cpe_product, cpe_version DESC
LIMIT 10

id    |title                                                         |cpe_part|cpe_vendor|cpe_product|cpe_version|cpe_update|cpe_edition|cpe_language|cpe_sw_edition|cpe_target_sw|cpe_target_hw|cpe_other|
------+--------------------------------------------------------------+--------+----------+-----------+-----------+----------+-----------+------------+--------------+-------------+-------------+---------+
460088|GNU Bourne-Again SHell bash (GNU Bash) 4.3.30 Beta 1          |a       |gnu       |bash       |4.3.30     |beta1     |           |            |              |             |             |         |
460086|GNU Bourne-Again SHell bash (GNU Bash) 4.2.53 Beta 1          |a       |gnu       |bash       |4.2.53     |beta1     |           |            |              |             |             |         |
460081|GNU Bourne-Again SHell bash (GNU Bash) 3.2.57 Beta 1          |a       |gnu       |bash       |3.2.57     |beta1     |           |            |              |             |             |         |
460140|GNU Bourne-Again SHell bash (GNU Bash) 5.2                    |a       |gnu       |bash       |5.2        |-         |           |            |              |             |             |         |
460141|GNU Bourne-Again SHell bash (GNU Bash) 5.2 Alpha              |a       |gnu       |bash       |5.2        |alpha     |           |            |              |             |             |         |
460142|GNU Bourne-Again SHell bash (GNU Bash) 5.2 Beta               |a       |gnu       |bash       |5.2        |beta      |           |            |              |             |             |         |
460143|GNU Bourne-Again SHell bash (GNU Bash) 5.2 Release Candidate 1|a       |gnu       |bash       |5.2        |rc1       |           |            |              |             |             |         |
460144|GNU Bourne-Again SHell bash (GNU Bash) 5.2 Release Candidate 2|a       |gnu       |bash       |5.2        |rc2       |           |            |              |             |             |         |
460145|GNU Bourne-Again SHell bash (GNU Bash) 5.2 Release Candidate 3|a       |gnu       |bash       |5.2        |rc3       |           |            |              |             |             |         |
460146|GNU Bourne-Again SHell bash (GNU Bash) 5.2 Release Candidate 4|a       |gnu       |bash       |5.2        |rc4       |           |            |              |             |             |         |
```
2026-04-08 16:18:11 -04:00
Samuel Dionne-Riel
e52e23f041 doc/meta: Fix documentation for edition CPE field
The field could have been simply removed from the list, as it is not
used, but it should be present in that form at least for *some
undefined* length of time to present as a correction for anyone using
the `edition` field mistakenly.

My claim comes from the literal source listed in the next paragraph
(NISTIR 7695), the first few words of `5.3.3.6` are:

> The edition attribute is considered deprecated

Thus we consider it deprecated.

Furthermore the section documents that it should be using the value
`ANY`. It could be considered debatable as `NA` should be used “when
there is no legal or meaningful value for that attribute, or when
that attribute is not used as part of the description”... But the spec
states that `ANY` should be used, so we state `ANY` should be used.
2026-04-08 16:18:09 -04:00
Samuel Dionne-Riel
9ac62ecd61 doc/meta: Reword *logical values* for CPEs
The original wording missed the *not meaningful* nuance, and adding an
`or` clause within the sentence would have made it hard to understand.

Instead, it is now split into a list, and ordered in the same order as
found in `5.3.1` in NISTIR 7695.

The logical name used by the specification (ANY/NA) was also added.
2026-04-08 16:18:06 -04:00
Ulysses Zhan
ef398065f1 lib.sourceTypes: add obfuscatedCode 2026-04-02 20:42:34 -07:00
Silvan Mosberger
2e97caa6d3 stdenv: Use meta.problems for meta.broken underneath
And add tests for it
2026-03-13 19:36:57 +01:00
d068328
e47455f51d Revert "stdenv: pURL implementation (#421125)"
This reverts commit 5427115670, reversing
changes made to 88ee2ac331.
2025-10-18 20:41:01 +00:00
Hans Joachim Kliemeck
81dc446ee3 stdenv: pURL review suggestions - align naming
Co-authored-by: Philippe Ombredanne <pombredanne@gmail.com>
2025-10-10 17:17:13 +02:00
Hans Joachim Kliemeck
25f90d7d20 stdenv: pURL review suggestions - part 3 2025-10-10 14:38:19 +02:00
Hans Joachim Kliemeck
2e46d00d76 stdenv: pURL docu enhancements & list interface 2025-10-03 21:19:09 +00:00
h0nIg
4e2614fc07 stdenv: pURL implementation 2025-10-03 21:19:09 +00:00
Yuriy Taraday
dd12290517 Reapply "stdenv: Add CPE fields to meta"
This reverts commit de74f9caf0.
2025-09-15 17:25:11 +02:00
K900
de74f9caf0 Revert "stdenv: Add CPE fields to meta" 2025-08-30 09:29:43 +03:00
Yuriy Taraday
b0ce3dc09f stdenv: Add CPE fields to meta
Add `identifiers` attr to `meta` attribute with following attrs:
* `cpe` with the full CPE string when available
* `possibleCPEs` with the list of potential CPEs when not all
  information is provided
* `cpeParts` with the destructured CPE string, allowing to override it
  whenever needed
* `v1` attribute set with `cpe` and `cpeParts` from above and a
  guarantee of a backwards-compatible interface

Related issue: https://github.com/NixOS/nixpkgs/issues/354012
2025-08-29 15:40:03 +02:00
Wolfgang Walther
62fe016519 treewide: run treefmt with mdcr/nixfmt 2025-07-24 13:52:31 +02:00
Anthony ROUSSEL
c0a2db752e doc: add knownVulnerabilities 2025-04-30 23:23:03 +02:00
Tristan Ross
e2b2bc4033 docs: add new meta.teams 2025-04-17 23:54:29 -07:00
Pol Dellaiera
bcea0cf344 doc: update Nix code snippets format
Command: `mdcr --config doc/tests/mdcr-config.toml doc/`
2025-04-17 01:30:34 +02:00
Aleksana
40c6a068bd Merge pull request #324687 from kini/add-sourceProvenance-subheading
doc/meta: Add sourceProvenance to "Standard meta-attributes" section
2024-07-26 11:07:05 +08:00
Alexis Hildebrandt
ab42ca141a doc: Remove indefinite article and ending period from example meta.description
so that meta.description examples shown in the documentation
align with recommendations given in the "Meta attributes" section
in pkgs/README.md.

The changes were made with the following commands:
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*"([Aa]n?|[Tt]he)\s' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/"([Aa]n?|[Tt]he)\s(.)/"\U\2/'
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*".*\."' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/\."/"/'
2024-07-20 09:18:42 +02:00
Keshav Kini
89fcddbc8c doc/meta: Add sourceProvenance to "Standard meta-attributes" section
`meta.sourceProvenance` has its own level 2 heading at the bottom of the file,
but unlike the other meta-attributes it doesn't have a level 3 heading under the
"Standard meta-attributes" section.  Readers looking at the list of subheadings
directly under the "Standard meta-attributes" section header may not realize
that `meta.sourceProvenance` exists unless they scroll down to the bottom of the
page.

This commit adds a level 3 heading for sourceProvenance under "Standard
meta-attributes".
2024-07-04 14:58:25 -07:00
aleksana
19bbe0b3eb doc/meta: make meta.description consistent with contributing document 2024-07-04 01:22:08 +08:00
Travis A. Everett
9ff9bbdb34 doc: add stdenv passthru chapter (#315909)
* doc: add stdenv passthru chapter

Broad strokes:
- create the chapter
- move existing stdenv passthru coverage into it
- move out-of-place coverage of passthru.tests from the stdenv meta chapter into it
- (try to) apply 1-sentence-per-line to text I've touched
- add legacy anchors for everything moved
- update existing links to the new anchors
- add tentative motivating text
- make nixpkgs-internal links relative/branchless

razor: if it is only ever needed by contributors, which is likely if links
refer to the latest revision of the source code, then it's for
the contributor guide

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-06-11 10:51:03 +02:00
Doron Behar
0aa9043370 doc/meta: still mention testVersion near the installCheckPhase recommendation 2024-05-30 16:33:27 +03:00
Doron Behar
444c2b6dd0 doc/meta: Mention --version as a good usecase for installCheckPhase 2024-05-30 16:09:04 +03:00
Doron Behar
f4e6f41b72 doc/meta: better explain an advantage or passthru.tests 2024-05-30 16:09:03 +03:00
Doron Behar
f4e7ce7719 doc/meta: small link target shortenning
Shorten the path from the link to the to actual content about
passthru.tests - the content was moved into pkgs/README.md .
2024-05-30 16:09:03 +03:00
Doron Behar
2093ef28d9 doc/meta: mention how Hydra and other tools don't run passthru.tests 2024-05-30 16:09:03 +03:00
Alyssa Ross
20ca4f5529 doc: fix meta.badPlatforms example
error: attribute 'isStatic' missing
2024-05-13 10:24:25 +02:00
K900
59bccda153 Revert "stdenv: add meta.repository field"
This reverts commit 7e1443abbb.
2024-03-30 17:19:21 +03:00
a-n-n-a-l-e-e
2809c84cfb Merge pull request #294347 from lolbinarycat/meta.repository
stdenv: add meta.repository field
2024-03-29 13:03:04 -07:00
binarycat
7e1443abbb stdenv: add meta.repository field 2024-03-29 14:34:09 -04:00
Janne Heß
fcc95ff817 treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
2024-03-28 09:28:12 +01:00
Anderson Torres
e671d3bbbd Nix docs: remove with lib; from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.

Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.

However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.

However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.

On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.

That being said, this patch removes most of example code in the current
documentation.

The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md

because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
2024-03-06 11:40:09 -03:00
asymmetric
b414f942e0 doc: link, instead of just mentioning, Nix manual (#255126)
Instead of just telling the reader to go find the relevant section of the Nix
manual, let's just link to it. Yay hypertext!
2023-09-14 17:09:39 +02:00
Maximilian Ehlers
a29cf4aece Link to usage of pkg description instead of referring to nix-env (#255127)
* Updates meta.chapter.md with a reference link to the usage of the package description field instead of referring to nix-env

---------

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-09-14 16:59:20 +02:00
Artturin
61c0ecea5b treewide: update mainProgram docs 2023-08-04 20:31:16 +03:00
Valentin Gagarin
b4b928466a Merge pull request #237068 from pennae/manual-normalization 2023-06-13 07:35:06 +02:00
Andrew
1b6f640687 doc: correct typos and spelling (#237098) 2023-06-11 02:15:43 +02:00
pennae
2ecc93d6fe doc: normalize markdown for nixos-render-docs
pandoc recognizes `::: note` admonitions, nixos-render-docs only
recognizes `::: {.note}`. surprisingly pandoc also emits the correct
docbook tags for `[](#xref)`s, so we can use that too.
2023-06-10 18:17:05 +02:00
Alyssa Ross
caa0a24ab0 doc: clarify that meta.timeout is only for Hydra
I read this and expected it to be a timeout that was always applied
when building the derivation, but it's actually a Hydra-specific
thing.
2023-05-30 10:27:44 +00:00
Adam Joseph
372e0f8efc doc/stdenv/meta.chapter.md: document meta.badPlatforms (#225276)
* doc/stdenv/meta.chapter.md: document meta.badPlatforms

We don't have any documentation for the `meta.badPlatforms` attribute.

This commit adds documentation for it.
2023-04-24 10:06:50 +02:00
Adam Joseph
75bbbbd39b remove trailing whitespace 2023-04-23 21:32:40 -07:00
Adam Joseph
401430319c Update doc/stdenv/meta.chapter.md
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-04-24 04:31:38 +00:00
Adam Joseph
467ee31e58 Update doc/stdenv/meta.chapter.md
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-04-24 04:30:37 +00:00