Change:
Steps to reproduce the behavior: onionshare <!-- Please @ people who are in the list of the offending package or module. If in doubt, check for whoever last touched something. -- Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
The package distutils was remove in Python 3.12. Depends on upsteam. I raised a PR for the fix:

Discussion:
{ lib , stdenv <del> , buildPythonApplication , colorama </del> , fetchFromGitHub , fetchpatch <del> , flask , flask-compress , flask-socketio , gevent-websocket </del> , obfs4 <del> , psutil , packaging , pycrypto , pynacl , pyside6 , pysocks , pytestCheckHook , qrcode </del> <ins> , python3 </ins> , qt5 <del> , requests </del> , snowflake <del> , stem </del> , substituteAll , tor <del> , unidecode , waitress , werkzeug </del> }: let version = "2.6.2"; src = fetchFromGitHub { owner = "onionshare"; repo = "onionshare"; rev = "v${version}"; hash = "sha256-J8Hdriy8eWpHuMCI87a9a/zCR6xafM3A/Tkyom0Ktko="; }; meta = with lib; { description = "Securely and anonymously send and receive files"; longDescription = ''

# TODO: package meek https://support.torproject.org/glossary/meek/ meek = "/meek-not-available"; in rec { <del> onionshare = buildPythonApplication { </del> <ins> onionshare = python3.pkgs.buildPythonApplication { </ins> pname = "onionshare-cli"; inherit version; src = "${src}/cli";

inherit tor meek obfs4 snowflake; inherit (tor) geoip; }) <ins> # Remove distutils for Python 3.12 compatibility # https://github.com/onionshare/onionshare/pull/1907 (fetchpatch { url = "https://github.com/onionshare/onionshare/commit/1fb1a470df20d8a7576c8cf51213e5928528d59a.patch"; includes = [ "onionshare_cli/onion.py" ]; stripLen = 1; hash = "sha256-4XkqaEhMhvj6PyMssnLfXRazdP4k+c9mMDveho7pWg8="; }) </ins> ]; <del> propagatedBuildInputs = [ </del> <ins> dependencies = with python3.pkgs; [ </ins> colorama flask flask-compress

pyside6 pysocks qrcode <del> qrcode </del> requests stem unidecode

tor ]; <del> nativeCheckInputs = [ </del> <ins> nativeCheckInputs = with python3.pkgs; [ </ins> pytestCheckHook ];

}; }; <del> onionshare-gui = buildPythonApplication { </del> <ins> onionshare-gui = python3.pkgs.buildPythonApplication { </ins> pname = "onionshare"; inherit version; src = "${src}/desktop";

stripLen = 1; hash = "sha256-wfIjdPhdUYAvbK5XyE1o2OtFOlJRj0X5mh7QQRjdyP0="; }) <ins> # Remove distutils for Python 3.12 compatibility # https://github.com/onionshare/onionshare/pull/1907 (fetchpatch { url = "https://github.com/onionshare/onionshare/commit/1fb1a470df20d8a7576c8cf51213e5928528d59a.patch"; includes = [ "onionshare/update_checker.py" ]; stripLen = 1; hash = "sha256-mRRj9cALZVHw86CgU17sp9EglKhkRRcGfROyQpsXVfU="; }) </ins> ]; <del> propagatedBuildInputs = [ </del> <ins> dependencies = with python3.pkgs; [ </ins> onionshare pyside6 qrcode

omxplayer = callPackage ../applications/video/omxplayer { }; <del> inherit (python3Packages.callPackage ../applications/networking/onionshare { }) onionshare onionshare-gui; </del> <ins> inherit (callPackage ../applications/networking/onionshare { }) onionshare onionshare-gui; </ins> openambit = qt5.callPackage ../applications/misc/openambit { };