Merge pull request #262648 from ShamrockLee/doc-builder

Documentation for the builders (renamed: build helpers)

authored by

Valentin Gagarin and committed by
GitHub
bb6b849c a1c55196

+54 -38
+3 -3
.github/CODEOWNERS
··· 61 61 /pkgs/build-support/writers @lassulus @Profpatsch 62 62 63 63 # Nixpkgs make-disk-image 64 - /doc/builders/images/makediskimage.section.md @raitobezarius 64 + /doc/build-helpers/images/makediskimage.section.md @raitobezarius 65 65 /nixos/lib/make-disk-image.nix @raitobezarius 66 66 67 67 # Nixpkgs documentation ··· 219 219 /nixos/tests/knot.nix @mweinelt 220 220 221 221 # Web servers 222 - /doc/builders/packages/nginx.section.md @raitobezarius 222 + /doc/packages/nginx.section.md @raitobezarius 223 223 /pkgs/servers/http/nginx/ @raitobezarius 224 224 /nixos/modules/services/web-servers/nginx/ @raitobezarius 225 225 ··· 272 272 # Docker tools 273 273 /pkgs/build-support/docker @roberth 274 274 /nixos/tests/docker-tools* @roberth 275 - /doc/builders/images/dockertools.section.md @roberth 275 + /doc/build-helpers/images/dockertools.section.md @roberth 276 276 277 277 # Blockchains 278 278 /pkgs/applications/blockchains @mmahut @RaghavSood
+28
doc/build-helpers.md
··· 1 + # Build helpers {#part-builders} 2 + 3 + A build helper is a function that produces derivations. 4 + 5 + :::{.warning} 6 + This is not to be confused with the [`builder` argument of the Nix `derivation` primitive](https://nixos.org/manual/nix/unstable/language/derivations.html), which refers to the executable that produces the build result, or [remote builder](https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html), which refers to a remote machine that could run such an executable. 7 + ::: 8 + 9 + Such a function is usually designed to abstract over a typical workflow for a given programming language or framework. 10 + This allows declaring a build recipe by setting a limited number of options relevant to the particular use case instead of using the `derivation` function directly. 11 + 12 + [`stdenv.mkDerivation`](#part-stdenv) is the most widely used build helper, and serves as a basis for many others. 13 + In addition, it offers various options to customize parts of the builds. 14 + 15 + There is no uniform interface for build helpers. 16 + [Trivial build helpers](#chap-trivial-builders) and [fetchers](#chap-pkgs-fetchers) have various input types for convenience. 17 + [Language- or framework-specific build helpers](#chap-language-support) usually follow the style of `stdenv.mkDerivation`, which accepts an attribute set or a fixed-point function taking an attribute set. 18 + 19 + ```{=include=} chapters 20 + build-helpers/fetchers.chapter.md 21 + build-helpers/trivial-build-helpers.chapter.md 22 + build-helpers/testers.chapter.md 23 + build-helpers/special.md 24 + build-helpers/images.md 25 + hooks/index.md 26 + languages-frameworks/index.md 27 + packages/index.md 28 + ```
+10
doc/build-helpers/special.md
··· 1 + # Special build helpers {#chap-special} 2 + 3 + This chapter describes several special build helpers. 4 + 5 + ```{=include=} sections 6 + special/fhs-environments.section.md 7 + special/makesetuphook.section.md 8 + special/mkshell.section.md 9 + special/vm-tools.section.md 10 + ```
-12
doc/builders.md
··· 1 - # Builders {#part-builders} 2 - 3 - ```{=include=} chapters 4 - builders/fetchers.chapter.md 5 - builders/trivial-builders.chapter.md 6 - builders/testers.chapter.md 7 - builders/special.md 8 - builders/images.md 9 - hooks/index.md 10 - languages-frameworks/index.md 11 - builders/packages/index.md 12 - ```
doc/builders/fetchers.chapter.md doc/build-helpers/fetchers.chapter.md
doc/builders/images.md doc/build-helpers/images.md
doc/builders/images/appimagetools.section.md doc/build-helpers/images/appimagetools.section.md
doc/builders/images/binarycache.section.md doc/build-helpers/images/binarycache.section.md
doc/builders/images/dockertools.section.md doc/build-helpers/images/dockertools.section.md
doc/builders/images/makediskimage.section.md doc/build-helpers/images/makediskimage.section.md
doc/builders/images/ocitools.section.md doc/build-helpers/images/ocitools.section.md
doc/builders/images/portableservice.section.md doc/build-helpers/images/portableservice.section.md
doc/builders/images/snaptools.section.md doc/build-helpers/images/snaptools.section.md
doc/builders/packages/cataclysm-dda.section.md doc/packages/cataclysm-dda.section.md
doc/builders/packages/citrix.section.md doc/packages/citrix.section.md
doc/builders/packages/dlib.section.md doc/packages/dlib.section.md
doc/builders/packages/eclipse.section.md doc/packages/eclipse.section.md
doc/builders/packages/elm.section.md doc/packages/elm.section.md
doc/builders/packages/emacs.section.md doc/packages/emacs.section.md
doc/builders/packages/etc-files.section.md doc/packages/etc-files.section.md
doc/builders/packages/firefox.section.md doc/packages/firefox.section.md
doc/builders/packages/fish.section.md doc/packages/fish.section.md
doc/builders/packages/fuse.section.md doc/packages/fuse.section.md
doc/builders/packages/ibus.section.md doc/packages/ibus.section.md
+1
doc/builders/packages/index.md doc/packages/index.md
··· 4 4 5 5 ```{=include=} sections 6 6 citrix.section.md 7 + darwin-builder.section.md 7 8 dlib.section.md 8 9 eclipse.section.md 9 10 elm.section.md
doc/builders/packages/kakoune.section.md doc/packages/kakoune.section.md
doc/builders/packages/linux.section.md doc/packages/linux.section.md
doc/builders/packages/locales.section.md doc/packages/locales.section.md
doc/builders/packages/nginx.section.md doc/packages/nginx.section.md
doc/builders/packages/opengl.section.md doc/packages/opengl.section.md
doc/builders/packages/shell-helpers.section.md doc/packages/shell-helpers.section.md
doc/builders/packages/steam.section.md doc/packages/steam.section.md
doc/builders/packages/urxvt.section.md doc/packages/urxvt.section.md
doc/builders/packages/weechat.section.md doc/packages/weechat.section.md
doc/builders/packages/xorg.section.md doc/packages/xorg.section.md
-11
doc/builders/special.md
··· 1 - # Special builders {#chap-special} 2 - 3 - This chapter describes several special builders. 4 - 5 - ```{=include=} sections 6 - special/fhs-environments.section.md 7 - special/makesetuphook.section.md 8 - special/mkshell.section.md 9 - special/darwin-builder.section.md 10 - special/vm-tools.section.md 11 - ```
+8 -8
doc/builders/special/darwin-builder.section.md doc/packages/darwin-builder.section.md
··· 1 1 # darwin.linux-builder {#sec-darwin-builder} 2 2 3 - `darwin.linux-builder` provides a way to bootstrap a Linux builder on a macOS machine. 3 + `darwin.linux-builder` provides a way to bootstrap a Linux remote builder on a macOS machine. 4 4 5 5 This requires macOS version 12.4 or later. 6 6 7 - The builder runs on host port 31022 by default. 7 + The remote builder runs on host port 31022 by default. 8 8 You can change it by overriding `virtualisation.darwin-builder.hostPort`. 9 9 See the [example](#sec-darwin-builder-example-flake). 10 10 ··· 15 15 extra-trusted-users = <your username goes here> 16 16 ``` 17 17 18 - To launch the builder, run the following flake: 18 + To launch the remote builder, run the following flake: 19 19 20 20 ```ShellSession 21 21 $ nix run nixpkgs#darwin.linux-builder ··· 57 57 builders-use-substitutes = true 58 58 ``` 59 59 60 - To allow Nix to connect to a builder not running on port 22, you will also need to create a new file at `/etc/ssh/ssh_config.d/100-linux-builder.conf`: 60 + To allow Nix to connect to a remote builder not running on port 22, you will also need to create a new file at `/etc/ssh/ssh_config.d/100-linux-builder.conf`: 61 61 62 62 ``` 63 63 Host linux-builder ··· 130 130 } 131 131 ``` 132 132 133 - ## Reconfiguring the builder {#sec-darwin-builder-reconfiguring} 133 + ## Reconfiguring the remote builder {#sec-darwin-builder-reconfiguring} 134 134 135 - Initially you should not change the builder configuration else you will not be 136 - able to use the binary cache. However, after you have the builder running locally 137 - you may use it to build a modified builder with additional storage or memory. 135 + Initially you should not change the remote builder configuration else you will not be 136 + able to use the binary cache. However, after you have the remote builder running locally 137 + you may use it to build a modified remote builder with additional storage or memory. 138 138 139 139 To do this, you just need to set the `virtualisation.darwin-builder.*` parameters as 140 140 in the example below and rebuild.
doc/builders/special/fhs-environments.section.md doc/build-helpers/special/fhs-environments.section.md
+1 -1
doc/builders/special/makesetuphook.section.md doc/build-helpers/special/makesetuphook.section.md
··· 1 1 # pkgs.makeSetupHook {#sec-pkgs.makeSetupHook} 2 2 3 - `pkgs.makeSetupHook` is a builder that produces hooks that go in to `nativeBuildInputs` 3 + `pkgs.makeSetupHook` is a build helper that produces hooks that go in to `nativeBuildInputs` 4 4 5 5 ## Usage {#sec-pkgs.makeSetupHook-usage} 6 6
doc/builders/special/mkshell.section.md doc/build-helpers/special/mkshell.section.md
doc/builders/special/vm-tools.section.md doc/build-helpers/special/vm-tools.section.md
doc/builders/testers.chapter.md doc/build-helpers/testers.chapter.md
+1 -1
doc/builders/trivial-builders.chapter.md doc/build-helpers/trivial-build-helpers.chapter.md
··· 1 - # Trivial builders {#chap-trivial-builders} 1 + # Trivial build helpers {#chap-trivial-builders} 2 2 3 3 Nixpkgs provides a couple of functions that help with building derivations. The most important one, `stdenv.mkDerivation`, has already been documented above. The following functions wrap `stdenv.mkDerivation`, making it easier to use in certain cases. 4 4
+1 -1
doc/manual.md.in
··· 9 9 using-nixpkgs.md 10 10 lib.md 11 11 stdenv.md 12 - builders.md 12 + build-helpers.md 13 13 development.md 14 14 contributing.md 15 15 ```
+1 -1
doc/stdenv/stdenv.chapter.md
··· 528 528 ``` 529 529 ::: 530 530 531 - ### Recursive attributes in `mkDerivation` {#mkderivation-recursive-attributes} 531 + ### Fixed-point arguments of `mkDerivation` {#mkderivation-recursive-attributes} 532 532 533 533 If you pass a function to `mkDerivation`, it will receive as its argument the final arguments, including the overrides when reinvoked via `overrideAttrs`. For example: 534 534