diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index 7c81e861ddbc..feb0b996b61c 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -7,13 +7,15 @@ # 3) used by `google-cloud-sdk` only on GCE guests # -{ stdenv, lib, fetchurl, makeWrapper, python, cffi, cryptography, pyopenssl, - crcmod, google-compute-engine, with-gce ? false }: +{ stdenv, lib, fetchurl, makeWrapper, python, with-gce ? false }: let - pythonInputs = [ cffi cryptography pyopenssl crcmod ] - ++ lib.optional (with-gce) google-compute-engine; - pythonPath = lib.makeSearchPath python.sitePackages pythonInputs; + pythonEnv = python.withPackages (p: with p; [ + cffi + cryptography + pyopenssl + crcmod + ] ++ lib.optional (with-gce) google-compute-engine); baseUrl = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads"; sources = name: system: { @@ -53,8 +55,8 @@ in stdenv.mkDerivation rec { programPath="$out/google-cloud-sdk/bin/$program" binaryPath="$out/bin/$program" wrapProgram "$programPath" \ - --set CLOUDSDK_PYTHON "${python}/bin/python" \ - --prefix PYTHONPATH : "${pythonPath}" + --set CLOUDSDK_PYTHON "${pythonEnv}/bin/python" \ + --prefix PYTHONPATH : "${pythonEnv}/${python.sitePackages}" mkdir -p $out/bin ln -s $programPath $binaryPath diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 63921241cded..7bc8fbff4d46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3488,8 +3488,8 @@ in google-authenticator = callPackage ../os-specific/linux/google-authenticator { }; - google-cloud-sdk = python2.pkgs.google-cloud-sdk; - google-cloud-sdk-gce = python2.pkgs.google-cloud-sdk-gce; + google-cloud-sdk = callPackage ../tools/admin/google-cloud-sdk { }; + google-cloud-sdk-gce = google-cloud-sdk.override { with-gce = true; }; google-fonts = callPackage ../data/fonts/google-fonts { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8f9f0d6627c0..0e5259a8a241 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2384,9 +2384,6 @@ in { python-gitlab = callPackage ../development/python-modules/python-gitlab { }; - google-cloud-sdk = callPackage ../tools/admin/google-cloud-sdk { }; - google-cloud-sdk-gce = callPackage ../tools/admin/google-cloud-sdk { with-gce=true; }; - google-compute-engine = callPackage ../tools/virtualization/google-compute-engine { }; google-music = callPackage ../development/python-modules/google-music { };