Python: Difference between revisions

34j (talk | contribs)
34j (talk | contribs)
Undo revision 20458 by 34j (talk)
Tag: Undo
Line 159: Line 159:
   };
   };
   # https://github.com/nix-community/nix-ld?tab=readme-ov-file#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld
   # https://github.com/nix-community/nix-ld?tab=readme-ov-file#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld
  # https://github.com/search?q=%22export+LD_LIBRARY_PATH%3D%24NIX_LD_LIBRARY_PATH%22+python&type=code
   environment.systemPackages = [
   environment.systemPackages = [
     (pkgs.writeShellScriptBin "python" ''
     (pkgs.writeShellScriptBin "python" ''
       export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
       export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
       exec ${pkgs.python311}/bin/python "$@"
       exec ${pkgs.python3}/bin/python "$@"
     '')
     '')
   ];
   ];
   # another dangerous but simple solution
   # another (dangerous) solution
  # https://github.com/nix-community/nix-ld?tab=readme-ov-file#why-not-set-ld_library_path-directly-instead-of-nix_ld_library_path
   # environment.systemPackages = with pkgs; [ python3 ];
   # environment.systemPackages = with pkgs; [ python311 poetry ];
   # programs.bash = {
   # programs.bash = {
   #  enable = true;
   #  enable = true;