I’m trying to provide some helper functions for easy usage across my nixos configuration using the nixpkgs.overlays functionality. Something like this:
nixpkgs redefines lib, so editing it in an overlay doesn’t affect the lib from the NixOS module system. You can set _module.args.helper to add a helper argument to the NixOS module system if you want (be warned, this sometimes makes confusing infinite recursion errors if you’re not careful).
Also, tangential FYI, I think you have prev and final backwards in your overlay. The first argument represents the final pkgs, and the second argument represents pkgs before this overlay is applied.
You can set _module.args.helper to add a helper argument to the NixOS module system if you want (be warned, this sometimes makes confusing infinite recursion errors if you’re not careful).
Wow, this works well! Though it does seem like I’m touching something internal that might break in the future, but it does simplify passing of various helpers a LOT. Thanks a bunch.
@ilkecan I don’t use flakes, but I do have to get into them eventually. Thanks.