Proper way of applying patch to system managed via flake

There is a relevant issue to make it simpler/built-in: Support flake references to patches · Issue #3920 · NixOS/nix · GitHub

Last time I had trouble getting something like what ryantm suggests working, although this looks simpler than the examples in the issue.
So I forked nixpkgs, created a branch with my current locked revision + the PR commits applied on top, then changed my nixpkgs input to point to that.