mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-09 16:18:34 +01:00
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)
```
|
||
|---|---|---|
| .. | ||
| cross-compilation.chapter.md | ||
| meta.chapter.md | ||
| multiple-output.chapter.md | ||
| passthru.chapter.md | ||
| platform-notes.chapter.md | ||
| stdenv.chapter.md | ||