summary refs log tree commit diff
path: root/pkgs/tools/virtualization
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2021-12-03 17:19:52 +0100
committertalyz <kim.lindberger@gmail.com>2021-12-03 17:30:55 +0100
commit5a4ea496b6b51d62337338162797e4feef729b50 (patch)
tree5592ccd556610a10b120f347e7d68e2cc8d231fb /pkgs/tools/virtualization
parent50474e185782880d5d7bffd400ac9a400d1ac668 (diff)
downloadnixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.tar
nixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.tar.gz
nixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.tar.bz2
nixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.tar.lz
nixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.tar.xz
nixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.tar.zst
nixpkgs-5a4ea496b6b51d62337338162797e4feef729b50.zip
Revert "google-compute-engine: 20190124 -> 20200113.0 (#131761)"
This reverts commit 1748291445122f91aa305de48704fc384c1e6f20.

This upgrade broke the google-compute-config module. See
https://github.com/NixOS/nixpkgs/pull/144761 for more info.
Diffstat (limited to 'pkgs/tools/virtualization')
-rw-r--r--pkgs/tools/virtualization/google-compute-engine/default.nix91
1 files changed, 25 insertions, 66 deletions
diff --git a/pkgs/tools/virtualization/google-compute-engine/default.nix b/pkgs/tools/virtualization/google-compute-engine/default.nix
index fef461be7d7..ad187544aea 100644
--- a/pkgs/tools/virtualization/google-compute-engine/default.nix
+++ b/pkgs/tools/virtualization/google-compute-engine/default.nix
@@ -3,85 +3,26 @@
 , buildPythonPackage
 , bash
 , bashInteractive
+, systemd
 , util-linux
 , boto
 , setuptools
 , distro
-, stdenv
-, pythonOlder
-, pytestCheckHook
 }:
 
-let
-  guest-configs = stdenv.mkDerivation rec {
-    pname = "guest-configs";
-    version = "20210702.00";
-
-    src = fetchFromGitHub {
-      owner = "GoogleCloudPlatform";
-      repo = "guest-configs";
-      rev = version;
-      sha256 = "1965kdrb1ig3z4qwzvyzx1fb4282ak5vgxcvvg5k9c759pzbc5nn";
-    };
-
-    buildInputs = [ bash ];
-
-    dontConfigure = true;
-    dontBuild = true;
-
-    installPhase = ''
-      runHook preInstall
-
-      # allows to install the package in `services.udev.packages` in NixOS
-      mkdir -p $out/lib/udev $out/bin
-
-      cp -r "src/lib/udev/rules.d" $out/lib/udev
-      cp "src/lib/udev/google_nvme_id" $out/bin
-
-      for rules in $out/lib/udev/*.rules; do
-        substituteInPlace "$rules" \
-          --replace /bin/sh "${bash}/bin/sh" \
-          --replace /bin/umount "${util-linux}/bin/umount" \
-          --replace /usr/bin/logger "${util-linux}/bin/logger"
-      done
-
-      # sysctl snippets will be used by google-compute-config.nix
-      cp -r "src/etc/sysctl.d" $out
-
-      patchShebangs $out/bin/*
-
-      runHook postInstall
-    '';
-  };
-in
 buildPythonPackage rec {
   pname = "google-compute-engine";
-  version = "20200113.0";
+  version = "20190124";
 
   src = fetchFromGitHub {
     owner = "GoogleCloudPlatform";
     repo = "compute-image-packages";
-    rev = "506b9a0dbffec5620887660cd42c57b3cbbadba6";
-    sha256 = "0lmc426mvrajghpavhs6hwl19mgnnh08ziqx5yi15fzpnvwmb8vz";
+    rev = version;
+    sha256 = "08cy0jd463kng6hwbd3nfldsp4dpd2lknlvdm88cq795wy0kh4wp";
   };
 
-  buildInputs = [ bash guest-configs ];
-  propagatedBuildInputs = [ (if pythonOlder "3.7" then boto else distro) setuptools ];
-
-  preBuild = ''
-    cd packages/python-google-compute-engine
-  '';
-
-  disabledTests = [
-    "testExtractInterfaceMetadata"
-    "testCallDhclientIpv6"
-    "testWriteConfig"
-    "testCreateInterfaceMapNetifaces"
-    "testCreateInterfaceMapSysfs"
-    "testGetNetworkInterface"
-  ];
-
-  checkInputs = [ pytestCheckHook ];
+  buildInputs = [ bash ];
+  propagatedBuildInputs = [ boto setuptools distro ];
 
   postPatch = ''
     for file in $(find google_compute_engine -type f); do
@@ -91,15 +32,33 @@ buildPythonPackage rec {
         --replace /sbin/hwclock "${util-linux}/bin/hwclock"
       # SELinux tool ???  /sbin/restorecon
     done
+
+    substituteInPlace google_config/udev/64-gce-disk-removal.rules \
+      --replace /bin/sh "${bash}/bin/sh" \
+      --replace /bin/umount "${util-linux}/bin/umount" \
+      --replace /usr/bin/logger "${util-linux}/bin/logger"
+  '';
+
+  postInstall = ''
+    # allows to install the package in `services.udev.packages` in NixOS
+    mkdir -p $out/lib/udev/rules.d
+    cp -r google_config/udev/*.rules $out/lib/udev/rules.d
+
+    # sysctl snippets will be used by google-compute-config.nix
+    mkdir -p $out/sysctl.d
+    cp google_config/sysctl/*.conf $out/sysctl.d
+
+    patchShebangs $out/bin/*
   '';
 
+  doCheck = false;
   pythonImportsCheck = [ "google_compute_engine" ];
 
   meta = with lib; {
     description = "Google Compute Engine tools and services";
     homepage = "https://github.com/GoogleCloudPlatform/compute-image-packages";
     license = licenses.asl20;
-    maintainers = with maintainers; [ cpcloud zimbatm ];
+    maintainers = with maintainers; [ zimbatm ];
     platforms = platforms.linux;
   };
 }