in nixos a python installation is commonly put into the nix store,
however on nixos it can commonly happen that a python installation from the store is removed when its no longer reffered to in a nix profile/gc-root
an effect similar to dist-updates python uninstallation happens with the virtualenvs using such a python gets used after a nix-gc removing the supposedly no longer used python
Describe the solution you'd like
the intended mechanism for nix to ensure a tool used by something imperative/state-full, is to add a gc root to prevent early removal
in order to safely do this the ideal solution would be to enable a post create hook which would allow to invoke the nix tools to add a gc root
additionally it seems necessary to ensure the hook is installed in any virtualenv created as otherwise any virtualenv installed in those would exhibit the same issue
Alternative Solutions
scripts surrounding virtualenv where a possible idea, unfortunately that would leave api usages and virtualenv in a virtualenv unfixed
What's the problem this feature will solve?
in nixos a python installation is commonly put into the nix store, however on nixos it can commonly happen that a python installation from the store is removed when its no longer reffered to in a nix profile/gc-root
an effect similar to dist-updates python uninstallation happens with the virtualenvs using such a python gets used after a nix-gc removing the supposedly no longer used python
Describe the solution you'd like
the intended mechanism for nix to ensure a tool used by something imperative/state-full, is to add a gc root to prevent early removal
in order to safely do this the ideal solution would be to enable a post create hook which would allow to invoke the nix tools to add a gc root additionally it seems necessary to ensure the hook is installed in any virtualenv created as otherwise any virtualenv installed in those would exhibit the same issue
Alternative Solutions
scripts surrounding virtualenv where a possible idea, unfortunately that would leave api usages and virtualenv in a virtualenv unfixed