Solved - Trying to package a simple Python script, but it seems to need wrapGAppsNoGuiHook

You’ve really run into an unpleasant edge case here. There should probably be a way to use hooks with writePython*.

One side note: You almost certainly don’t need, and shouldn’t be using, an overlay here. Overlays are really for replacing dependencies of things in nixpkgs. There’s no reason all your packages have to be in pkgs. Just bind a variable to the output of writePython3Bin, and use the variable wherever you would have used pkgs.workrave-open-py.

If you must use an overlay anyway, use final.writers.writePython3Bin, final.python3Packages, and final.glib.out. It shouldn’t matter in most cases, but it’s good practice to always use final in an overlay anytime it wouldn’t infrec. It reduces the impact of the ordering of your overlays. Think of it like this: final == pkgs. By contrast, prev is a strange variant of pkgs that has all the indirect effects of all overlays (including this one) but lacks the direct effects of this overlay and any after it… so the only reason you use prev is when replacing a package with a modified version, since you need the pre-modification variant of that package in order to express the modification itself.

I’ve considered using a different variable naming pattern and starting my overlays with pkgs: prevpkgs: { to emphasize this.

1 Like