Another approach is not to patch nixpkgs at all, but just to "override" packages in Nixpkgs outside of the repository, and build them from your own project directories.
A simple example: I wanted to build FFMPEG, but with non-free libraries enabled (which is not the default). Rather than edit "ffmpeg-full" in the nixpkgs repo, I just overrode it:
# default.nix (in some project directory; call "nix build -f ." to run it)
with nixpkgs;
{
my-ffmpeg =
let overrides = {
nonfreeLicensing = true;
fdkaacExtlib = true;
ffplayProgram = false;
qtFaststartProgram = false;
};
attrs = {
name="my-ffmpeg-" + ffmpeg.version;
};
in
ffmpeg-full.override overrides // attrs;
}