diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml index 0776e70f14e1..765fc56c3bb3 100644 --- a/doc/coding-conventions.xml +++ b/doc/coding-conventions.xml @@ -661,8 +661,6 @@ src = fetchFromGitHub {
Patches - Only patches that are unique to nixpkgs should be - included in nixpkgs source. Patches available online should be retrieved using fetchpatch. @@ -676,5 +674,30 @@ patches = [ ]; + Otherwise, you can add a .patch file to the + nixpkgs repository. In the interest of keeping our + maintenance burden to a minimum, only patches that are unique + to nixpkgs should be added in this way. + +patches = [ ./0001-changes.patch ]; + + If you do need to do create this sort of patch file, + one way to do so is with git: + + Move to the root directory of the source code + you're patching. +$ cd the/program/source + If a git repository is not already present, + create one and stage all of the source files. +$ git init +$ git add . + Edit some files to make whatever changes need + to be included in the patch. + Use git to create a diff, and pipe the output + to a patch file: +$ git diff > nixpkgs/pkgs/the/package/0001-changes.patch + +
+