nixpkgs/pkgs/tools/virtualization/google-compute-engine/default.nix
R. RyanTM c5f42c7d35 google-compute-engine: 20180905 -> 20181011
Semi-automatic update generated by
https://github.com/ryantm/nixpkgs-update tools. This update was made
based on information from
https://repology.org/metapackage/google-compute-engine/versions
2018-11-09 19:03:58 -08:00

58 lines
1.5 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonApplication
, bash
, systemd
, utillinux
, boto
, setuptools
, distro
}:
buildPythonApplication rec {
name = "google-compute-engine-${version}";
version = "20181011";
namePrefix = "";
src = fetchFromGitHub {
owner = "GoogleCloudPlatform";
repo = "compute-image-packages";
rev = version;
sha256 = "1b3wyr412qh113xvs671dqnacidil61gisfvg79wbq6wrdwswkp8";
};
postPatch = ''
for file in $(find google_compute_engine -type f); do
substituteInPlace "$file" \
--replace /bin/systemctl "${systemd}/bin/systemctl" \
--replace /bin/bash "${bash}/bin/bash" \
--replace /sbin/hwclock "${utillinux}/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 "${utillinux}/bin/umount" \
--replace /usr/bin/logger "${utillinux}/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
'';
propagatedBuildInputs = [ boto setuptools distro ];
doCheck = false;
meta = with lib; {
description = "Google Compute Engine tools and services";
homepage = "https://github.com/GoogleCloudPlatform/compute-image-packages";
license = licenses.asl20;
maintainers = with maintainers; [ zimbatm ];
platforms = platforms.linux;
};
}