Qtile restarting incorrect python environment

Hello everyone,

I have been using QTile via services.xserver.windowManager.qtile options, and sometimes have the need to restart it via its restart command. This command closes the current instance of QTile and starts a new one. The problem is that it executes the script in qtile-unwrapped python environment. That environment is fine as far as one hasn’t added any packages to the services.xserver.windowManager.qtile.extraPackages. I have some packages there, and that means these are not loaded when restarting qtile.

I am not sure what the best solution is in this case. I have made temporary fix by overriding qtile-unwrapped propagatedBuildInputs with the same packages I have inside of extraPackages. This indeed resolves the issue, but it is sort of a sketchy solution.

Anyone has any better idea than this? I would like to eventually incorporate a fix into the nixpkgs itself to fix for everyone.

Here is the relevant QTile code that manages the restart qtile/libqtile/core/lifecycle.py at 73024e13fc7f7d2c87a8effe22642757314b5d95 · qtile/qtile · GitHub. Here is a patch in nixpkgs that fixes an issue where QTile won’t restart at all: nixpkgs/pkgs/development/python-modules/qtile/fix-restart.patch at 11d9b9e97bcb5091c8414bbf9e50eb0d5cd745a9 · NixOS/nixpkgs · GitHub