Generically it’s not possible to do so with only a flake input.
opened 07:21PM - 11 Aug 20 UTC
feature
UX
flakes
**Describe the bug**
There is a patch in nixpkgs https://github.com/NixOS/nix… pkgs/pull/59990 "Support patching nixpkgs" which is meant to support users who track a specific branch of nixpkgs (like nixpkgs-unstable or some release branch) but you would like to apply some unmerged pull requests or some other patches to that revision. This is really common flow for linux users in general. What people currently do is fork nixpkgs, create a branch based on your desired upstream branch and cherry-pick the commits you need on top of that branch. Then everytime you need to upgrade nixpkgs you rebase your branch on the latest upstream branch that you're tracking. IMHO a kinda consuming process if you just want a few patches.
Overall, this patch was a :-1: from @edolstra who commented the following as the most early retort:
> I'm -1 on this. It seems very ad hoc and hacky to make Nixpkgs rewrite its own source tree. That's the job of the version management tool (e.g. Git), which can do a much better job of managing sources and patches.
>
> Maybe flakes could provide this functionality (e.g. by having a flake reference like github:NixOS/nixpkgs?patch=./foo.patch) but I'm convinced it's a good idea.
This idea with flakes piqued my interest as possible, though.
@edolstra did eventually see the usefulness of such a functionality after the following comments https://github.com/NixOS/nixpkgs/pull/59990#issuecomment-490876722 https://github.com/NixOS/nixpkgs/pull/59990#issuecomment-490882052
I've opened this issue, as I'm not entirely sure how this should look like with flakes, but it is certainly something I'd like to have and would be an instant user of (and judging from the thumbs up on the PR in nixpkgs it would be welcome to many others).
**Pinging people from https://github.com/NixOS/nixpkgs/pull/59990**
@basvandijk @volth @edolstra
For nixpkgs we have applyPatches as mentioned above, at least. But IMO the usecase presented in the wiki is a bit silly, an override would make more sense for just bumping a single package’s version.
Since OP’s usecase is exactly the same - just use an override!
https://nixos.org/manual/nixpkgs/unstable/#sec-pkg-overrideAttrs
And @JBassett if you are stuck, post full code and full errors, no paraphrasing.