summary refs log tree commit diff
path: root/doc/builders
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-06-03 11:17:25 +0200
committerFlorian Klink <flokli@flokli.de>2022-06-03 14:37:31 +0200
commit1cefcfab2d3eb9274f4627a178a59d6f980f7f3b (patch)
tree25cd448fd8587224366f1ef48571f053eb4465eb /doc/builders
parent7b3000f1d0f24b5ad8bd51a70290167fc2819a50 (diff)
downloadnixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.tar
nixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.tar.gz
nixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.tar.bz2
nixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.tar.lz
nixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.tar.xz
nixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.tar.zst
nixpkgs-1cefcfab2d3eb9274f4627a178a59d6f980f7f3b.zip
nixos/doc: move fetchpatch documentation to fetcher documentation
… and link from the coding-conventions chapter to it.

Closes #48569.
Diffstat (limited to 'doc/builders')
-rw-r--r--doc/builders/fetchers.chapter.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/builders/fetchers.chapter.md b/doc/builders/fetchers.chapter.md
index 30591c1673c..70380248f8c 100644
--- a/doc/builders/fetchers.chapter.md
+++ b/doc/builders/fetchers.chapter.md
@@ -26,8 +26,20 @@ stdenv.mkDerivation {
 
 The main difference between `fetchurl` and `fetchzip` is in how they store the contents. `fetchurl` will store the unaltered contents of the URL within the Nix store. `fetchzip` on the other hand, will decompress the archive for you, making files and directories directly accessible in the future. `fetchzip` can only be used with archives. Despite the name, `fetchzip` is not limited to .zip files and can also be used with any tarball.
 
+## `fetchpatch` {#fetchpatch}
+
 `fetchpatch` works very similarly to `fetchurl` with the same arguments expected. It expects patch files as a source and performs normalization on them before computing the checksum. For example, it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.
 
+- `relative`: Similar to using `git-diff`'s `--relative` flag, only keep changes inside the specified directory, making paths relative to it.
+- `stripLen`: Remove the first `stripLen` components of pathnames in the patch.
+- `extraPrefix`: Prefix pathnames by this string.
+- `excludes`: Exclude files matching these patterns (applies after the above arguments).
+- `includes`: Include only files matching these patterns (applies after the above arguments).
+- `revert`: Revert the patch.
+
+Note that because the checksum is computed after applying these effects, using or modifying these arguments will have no effect unless the `sha256` argument is changed as well.
+
+
 Most other fetchers return a directory rather than a single file.
 
 ## `fetchsvn` {#fetchsvn}