Python - applications in nixos/nix # top level + change python3 reference

Python applications in nixos/nix can be create in several ways

toPythonApplication
google-compute-engine = with python38.pkgs; toPythonApplication google-compute-engine;

or
callPackage

google-cloud-sdk = callPackage ../tools/admin/google-cloud-sdk {
    python = python3;
  };

What is best practice (and is this somewhere documented/compared … )?

  • to me it feels so much easier to work with override

How to override Python3 in nixpkgs (without to clone and reference a pinned nixpkgs)?

python3 = python310;
python3Packages = dontRecurseIntoAttrs python310Packages;

alternative would be to override with python38. e.g. for google-compute-engine


regarding nixpkgs rev f10cdcf31dd2a436edbf7f0ad82c44b911804bc8

ovApp = self: super: rec { google-compute-engine = self.python310.pkgs.toPythonApplication self.python310.pkgs.google-compute-engine; };
does not work
neither to override python3 and python3Packages?