nixpkgs/doc/stdenv
Jade Lovelace a5fa5508db doc: Add necessary details to understand dep propagation
This section has been the subject of too many jokes about nixpkgs and nix
overall being incomprehensible among people I know. In lieu of adding to
the fray I've had a go at correcting the reasons I couldn't read it
myself.

I don't actually think the math is a problem; it's actually probably the
more understandable part of the section once you actually understand the
definitions. The missing definitions and leaving the truth table as an
exercise to the reader really was not working for me though.

I've also added what each dependency group is actually *for*. This
hopefully makes the section easier to understand how it applies in
practice.

I generated the initial version of the table before reformatting it and
removing pointless rows with:

```python
def mapOffset(h, t, i):
    return i + (h if i <= 0 else t - 1)

for h0 in (-1, 0, 1):
    for t0 in (-1, 0, 1):
        if t0 < h0: continue
        heading = f'{h0:3} | {t0:3}'
        for i in (-1, 0, 1):
            if h0 + i not in (-1, 0, 1):
                mapped = 'x'
            else:
                mapped = mapOffset(h0, t0, i)
            heading += f'  |  {mapped:>2}'
        print(heading)
```
2025-07-10 11:52:29 -07:00
..
cross-compilation.chapter.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
meta.chapter.md doc: add knownVulnerabilities 2025-04-30 23:23:03 +02:00
multiple-output.chapter.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
passthru.chapter.md doc: update Nix code snippets format 2025-04-17 01:30:34 +02:00
platform-notes.chapter.md doc/stdenv/platform-notes: fix typo 2025-01-15 02:04:39 +00:00
stdenv.chapter.md doc: Add necessary details to understand dep propagation 2025-07-10 11:52:29 -07:00