Home Explore Blog Models CI



nixpkgs

doc/packages/xorg.section.md
c45bacd2b81d80082a8ac218662ff342c2993ef29f2fef8900000003000009a2
# X.org {#sec-xorg}

The Nix expressions for the X.org packages reside in `pkgs/servers/x11/xorg/default.nix`. This file is automatically generated from lists of tarballs in an X.org release. As such, it should not be modified directly; rather, you should modify the lists, the generator script, or the file `pkgs/servers/x11/xorg/overrides.nix`, in which you can override or add to the derivations produced by the generator.

## Katamari Tarballs {#katamari-tarballs}

X.org upstream releases used to include [katamari](https://en.wiktionary.org/wiki/%E3%81%8B%E3%81%9F%E3%81%BE%E3%82%8A) releases, which included a holistic recommended version for each tarball, up until 7.7. To create a list of tarballs in a katamari release:

```ShellSession
export release="X11R7.7"
export url="mirror://xorg/$release/src/everything/"
cat $(PRINT_PATH=1 nix-prefetch-url $url | tail -n 1) \
  | perl -e 'while (<>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'url'}$2\n"; }; }' \
  | sort > "tarballs-$release.list"
```

## Individual Tarballs {#individual-tarballs}

The upstream release process for [X11R7.8](https://x.org/wiki/Releases/7.8/) does not include a planned katamari. Instead, each component of X.org is released as its own tarball. We maintain `pkgs/servers/x11/xorg/tarballs.list` as a list of tarballs for each individual package. This list includes X.org core libraries and protocol descriptions, extra newer X11 interface libraries, like `xorg.libxcb`, and classic utilities which are largely unused but still available if needed, like `xorg.imake`.

## Generating Nix Expressions {#generating-nix-expressions}

The generator is invoked as follows:

```ShellSession
cd pkgs/servers/x11/xorg
<tarballs.list perl ./generate-expr-from-tarballs.pl
```

For each of the tarballs in the `.list` files, the script downloads it, unpacks it, and searches its `configure.ac` and `*.pc.in` files for dependencies. This information is used to generate `default.nix`. The generator caches downloaded tarballs between runs. Pay close attention to the `NOT FOUND: $NAME` messages at the end of the run, since they may indicate missing dependencies. (Some might be optional dependencies, however.)

## Overriding the Generator {#overriding-the-generator}

If the expression for a package requires derivation attributes that the generator cannot figure out automatically (say, `patches` or a `postInstall` hook), you should modify `pkgs/servers/x11/xorg/overrides.nix`.

Chunks
259416fa (1st chunk of `doc/packages/xorg.section.md`)
Title: X.org Package Management in Nix
Summary
This document outlines the management of X.org packages within the Nix environment. The Nix expressions for X.org are automatically generated into `pkgs/servers/x11/xorg/default.nix` from lists of tarballs. Direct modification of this file is discouraged; instead, changes should be made to the generator script, the tarball lists, or `pkgs/servers/x11/xorg/overrides.nix` for custom derivation attributes. The text details how to handle both older "katamari" (holistic) releases (up to 7.7) and newer "individual tarball" releases (from 7.8 onwards, listed in `pkgs/servers/x11/xorg/tarballs.list`). It also describes the generation process, where a script parses downloaded tarballs for dependencies to create `default.nix`.