Commit Graph

212 Commits

Author SHA1 Message Date
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
Janne Heß
bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
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
github-actions[bot]
dc4a7c97b0
Merge master into staging-next 2024-01-18 18:00:55 +00:00
Peder Bergebakken Sundt
e07a2fab7f stdenv: substituteStream: deprecate --replace in favor of --replace-{fail,warn,quiet} 2024-01-14 22:07:58 +01:00
Olivia Crain
f6e6a6d80e
doc: replace pcre with pcre2 in example script
https://www.pcre.org/

The `pcre` library is "now at end of life, and is no longer being
maintained," according to the upstream maintainers. Accordingly, we
should replace uses of `pcre` with its actively maintained successor,
`pcre2`, wherever possible .
2024-01-03 11:36:03 -06:00
Silvan Mosberger
59a6f908b5
Merge pull request #271797 from bzm3r/master
doc: diagram explaining what it means for a dependency to be propagated
2023-12-21 17:14:30 +01:00
Brian Merchant
b37adfc009 doc: Clarify dependency propagation 2023-12-21 17:11:47 +01:00
Silvan Mosberger
6afebb56f8
Merge pull request #271360 from mattpolzin/patch-1
doc: clarify stdenv phase flag attributes
2023-12-20 20:37:41 +01:00
Danila Danko
ceb8e4efd9
doc: Update stdenv.chapter.md (#274706)
Extended genericBuild description
2023-12-16 13:32:15 +01:00
Mathew Polzin
fb9e48c6b9 doc: clarify stdenv phase flag attributes 2023-11-30 22:28:58 -06:00
Ivan Mincik
57801428da doc/stdenv: update manual phases execution instructions
Update instructions for manual build phases execution via `nix-shell` to
cover all phases. There is no easy way of getting those commands, so it
makes a sense to have them all properly documented.
2023-11-20 00:06:11 +01:00
Arnout Engelen
97b0ae26f7
doc: avoid 'simply' (#266434)
While the word 'simply' is usually added to encourage readers, it often has the
opposite effect and may even appear condescending, especially when the reader
runs into trouble trying to apply the suggestions from the documentation. It is
almost always an improvement to simply drop the word from the sentence.

(there are more possible improvements like this, we can apply those in separate
PRs)
2023-11-09 21:48:05 +01:00
Yueh-Shun Li
9d6da5bd1e doc: rename sub-section Recursive attributes in stdenv -> Fixed-point arguments in stdenv
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-11-07 19:58:54 +00:00
Jade Lovelace
0504bc63e4
doc/stdenv: rewrite manual build procedure to be closer to an auto-build (#262137)
* doc/stdenv: rewrite manual build procedure to be closer to an auto-build

This is based on
<https://jade.fyi/blog/building-nix-derivations-manually/> plus some
more original research.

The previous version of this section did not work for your choice of
simple Haskell package, e.g. haskellPackages.hscolour, due to things
like `compileBuildDriverPhase` and other custom phases that it
does not address at all.

It seems more correct to use genericBuild in development to harmonize it
with what is actually done.

I feel a little bit like I am committing a sin by suggesting using the
experimental CLI in the manual (afaict I am the first to do this), but I
have given the old version of the command, and there are justifiable
reasons to do it:
* The noted limitations with env-vars are fixed. The one with the
  non-empty temp directory was one I ran into myself and oh boy was that
  not fun to debug.
* Additionally the outputs are set *before* sourcing `setup.sh`: there
  is an issue with nix-shell where the original version of `$out` winds
  up in `NIX_LDFLAGS` due to _addRpathPrefix, which means that resulting
  executables may not run properly.

It is sad that `nix develop` propagates a wrong value of `SHELL` to
builders, though. It is equally sad that `nix-shell` is essentially
abandoned upstream, with undocumented and not insignificant differences
from `nix develop`.

For the exact script differences:
17e6b85d05/src/nix-build/nix-build.cc (L516-L551)
db026103b1/src/nix/get-env.sh

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-10-23 01:53:23 +02:00
Alejandro Sánchez Medina
cbd1748558
nixpkgs manual: add an alternative example in stdenv-separateDebugInfo (#257861)
* nixpkgs manual: add an alternative example in stdenv-separateDebugInfo

This change gets rid of the indirect reference to `nix-env -i` usage
and shows how to achieve the same goal with a shell expression.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-09-29 10:23:22 +02:00
Felix Yan
8ac0795c1f doc: fix wrong flag in description of bindnow
`-z bindnow` doesn't exist. The actual flag added is `-z now`.
2023-09-27 09:59:56 -03:00
Valentin Gagarin
370097ce86
remove the misleading warning on using nix-env for split outputs (#255947)
The text was originally added [0] following an apparently incomplete
research on how everything plays together. In fact, Nix propagates
`outputs` to the corresponding nested derivations, and there is some
messy behavior in Nixpkgs that only seems to propagate
`meta.outputsToInstall` in `buildEnv`[1].

This change moves the hints on how to use NixOS specifics to NixOS
module documentation (which is hopefully easier to find through
search.nixos.org), describes the default behavior in Nixpkgs (updating
a the link to the source), and removes the confusing mention of
`nix-env`.

the last of them should not be there to begin with. we don't want
beginners to use `nix-env`, as this is known to run them into trouble
eventually.

[0]: https://github.com/NixOS/nixpkgs/pull/76794
[1]: 1774d07242/pkgs/build-support/buildenv/default.nix (L66)
2023-09-25 16:23:01 +02:00
Maciej Krüger
7b737acb4a
Merge pull request #254967 from nbraud/sha256-to-hash/top-level 2023-09-15 14:36:49 +02: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
nicoo
fe138d36c9 doc: Replace sha256 with hash where appropriate 2023-09-13 17:24:49 +00:00
Artturi
31c9deb4f7
Merge pull request #218783 from timbertson/stripExcludeExtensions 2023-09-05 00:37:17 +03:00
Tim Cuthbertson
0bffcc3f3c setup-hooks/strip: add stripExclude 2023-09-03 20:18:10 +03:00
Artturi
ffc35fc054
Merge pull request #245583 from galenhuntington/doc-fix 2023-08-29 22:46:56 +03:00
Nick Hu
ae8aba3836
doc/stdenv/stdenv.chapter.md: add information about nix-update-script and nixpkgs-update 2023-08-15 10:13:39 +01:00
Artturin
61c0ecea5b treewide: update mainProgram docs 2023-08-04 20:31:16 +03:00
Jan Malakhovski
ccbb065c88 doc: make sourceRoot and setSourceRoot documentation match the implementation, fix examples 2023-08-03 16:32:05 +00:00
Galen Huntington
b0dc3d26f2
doc/stdenv: Minor syntax fix. 2023-07-26 12:15:32 -07:00
pennae
be4d19ff1a doc: render nixpkgs manual with nrd
also updates nixdoc to 2.3.0. the nixdoc update is not a separate commit
because that would leave the manual build broken for one commit,
potentially breaking bisects and rebases.
2023-07-01 20:59:29 +02: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
Nicolas Benes
142c24711e doc: fix typo 2023-05-20 22:09:52 +02:00
Jan Tojnar
8bf1967964 doc/stdenv/Dependencies: fix inference rule var name
t0 is mentioned in the conclusion so we cannot use placeholder in the premise.
2023-05-18 18:10:10 +02: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
8669061b61
Merge pull request #225272 from amjoseph-nixpkgs/pr/docs/broken-vs-badPlatforms
doc/stdenv/meta.chapter.md: explain difference between broken and badPlatforms
2023-04-24 05:09:01 +00: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
gilice
5d20d9ff9f doc/stdenv: don't use name in examples, highlight preferring pname 2023-04-15 16:06:29 +02:00
Adam Joseph
19d48a9257 doc/stdenv/meta.chapter.md: explain difference between broken and badPlatforms
There has been a longstanding ambiguity between `broken` and
`badPlatforms`, which seem to serve overlapping purposes.

This commit adds to the documentation two examples of constraints
which cannot be expressed by `platforms` and `badPlatforms`.

This commit also mentions `NIXPKGS_ALLOW_BROKEN=1` for overriding
`broken`.
2023-04-11 13:21:51 -07:00
pennae
052bb41410 doc: assign ids to many headings
without stable ids on headings we cannot generate stable links to these
headings. nrd complains about this, but the current docbook workflow
does not.

a few generated ids remain, mostly in examples and footnotes. most of
the examples are generated by nixdoc (which has since gained MD export
functions, and the MD export does generate IDs).
2023-03-27 22:39:11 +02:00
Valentin Gagarin
99c5413961
Merge pull request #200951 from jtojnar/docs-update-script-commit-feature
docs/stdenv: Document updateScript features
2023-03-21 12:50:35 +01:00
Jan Tojnar
90074803e6 docs/stdenv: Document updateScript features
This was removed in c1b05442ff
for stabilization but it has worked quite well.
2023-03-21 11:59:08 +01:00
Jan Tojnar
d0e8c7087d docs/stdenv: Document updateScript execution 2023-03-21 11:59:08 +01:00
Arnout Engelen
8ad8f9d266
doc/stdenv: add quotes to run phases with newlines
Without quotes newlines in environment variables get converted to spaces,
so any overridden phases would not work.
2023-03-17 13:30:57 +01:00