+40
docs/src/tips/overlays.md
+40
docs/src/tips/overlays.md
···+In some situations a python package may be bugged. This might have been fixed upstream by Nixpkgs devs, but has not reached `nixos-unstable` or whatever.+While overriding normal packages is relatively straightforward, doing so with python is most definitely not.+We have done this recently with the help of [Scrumplex] (thank you!) because a package was broken on nixos-unstable. Someone made a fix and it was merged, but it has yet to make it to nixos-unstable. This was blocking our systems from building so we decided to just say sod it, we're doing this.+Again, overriding simple packages that are not inside any package groups is wildly easier than this operation. Since not every package group is the same, this sample only focuses on Python because we only have experience with that.+Copy-paste the new package definiton next to the place where you're defining the overlay. We will be referencing it as `./package.nix`.+# this does not work because the package uses python3Packages. this is defining standalone package.+# we cannot use final'.pkgs.callPackage here because it's missing buildPythonModule or something.+# IMPORTANT: you need this! this is needed to let nix know we want to use our overrided python3 package earlier.+# if you don't add this, you will still be building the old package like nothing changed at all.+A full example is accessible [here](https://github.com/soopyc/gensokyo/tree/53fcb9bdeeede6e250c84a05ff8c6c1aca9b5fe6/global/overlays/temp/pyscard).