13 buildPythonPackage rec {
14 pname = "google-compute-engine";
17 src = fetchFromGitHub {
18 owner = "GoogleCloudPlatform";
19 repo = "compute-image-packages";
21 sha256 = "08cy0jd463kng6hwbd3nfldsp4dpd2lknlvdm88cq795wy0kh4wp";
24 buildInputs = [ bash ];
25 propagatedBuildInputs = [ boto setuptools distro ];
28 for file in $(find google_compute_engine -type f); do
29 substituteInPlace "$file" \
30 --replace /bin/systemctl "/run/current-system/systemd/bin/systemctl" \
31 --replace /bin/bash "${bashInteractive}/bin/bash" \
32 --replace /sbin/hwclock "${util-linux}/bin/hwclock"
33 # SELinux tool ??? /sbin/restorecon
36 substituteInPlace google_config/udev/64-gce-disk-removal.rules \
37 --replace /bin/sh "${bash}/bin/sh" \
38 --replace /bin/umount "${util-linux}/bin/umount" \
39 --replace /usr/bin/logger "${util-linux}/bin/logger"
43 # allows to install the package in `services.udev.packages` in NixOS
44 mkdir -p $out/lib/udev/rules.d
45 cp -r google_config/udev/*.rules $out/lib/udev/rules.d
47 # sysctl snippets will be used by google-compute-config.nix
48 mkdir -p $out/sysctl.d
49 cp google_config/sysctl/*.conf $out/sysctl.d
51 patchShebangs $out/bin/*
55 pythonImportsCheck = [ "google_compute_engine" ];
58 description = "Google Compute Engine tools and services";
59 homepage = "https://github.com/GoogleCloudPlatform/compute-image-packages";
60 license = licenses.asl20;
61 maintainers = with maintainers; [ zimbatm ];
62 platforms = platforms.linux;