I have submitted a package to nixpkgs, but it hasn’t been merged yet. In the meantime, I would like to be able to use it in my nixos configuration. How can I include a package from an alternate nixpkgs repo without replacing the official nixpkgs repo url with a link to a fork? Is there a way to add patches to flake input URL’s that I might be able to use?
PS: It’s probably worth noting that my system configuration is in a flake
In a flake, it’s quite easy. Just add an input like inputs.foo-pr.url = "github:me/nixpkgs/branch";, then pass that through to your nixos config, which there’s a good overview of how to do here, then you can put something like inputs.foo-pr.legacyPackages.${pkgs.system}.foo in your environment.systemPackages (whether you need inputs. will depend on how you passed it through).
Ah, that’s a great blog post! Thank you for sharing! I think it should work now, but I don’t know for sure because this issue is preventing my system from building
Is there a similar technique to this that would let me override the gmic package in my configuration to be the one from this PR so my system will build? gmic is a dependency of a few packages I have, so just adding it like this doesn’t fix it.
On my checkout of nixpkgs with extra commits/tweaks; I don’t know what’s the most ergo way to do this nowadays but that’s what I have been using for years.
However, there may be a diamond dependency mismatch issue with something like that. Another option is to make the overlay final.callPackage the individual file from the PR version of nixpkgs, which would get all of gmic's dependencies from your main nixpkgs version, rather than from the PR version, like with my overlay above.