nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 64 lines 1.8 kB view raw
1{ lib 2, fetchFromGitHub 3, buildPythonPackage 4, bash 5, bashInteractive 6, systemd 7, util-linux 8, boto 9, setuptools 10, distro 11}: 12 13buildPythonPackage rec { 14 pname = "google-compute-engine"; 15 version = "20190124"; 16 17 src = fetchFromGitHub { 18 owner = "GoogleCloudPlatform"; 19 repo = "compute-image-packages"; 20 rev = version; 21 sha256 = "08cy0jd463kng6hwbd3nfldsp4dpd2lknlvdm88cq795wy0kh4wp"; 22 }; 23 24 buildInputs = [ bash ]; 25 propagatedBuildInputs = [ boto setuptools distro ]; 26 27 postPatch = '' 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 34 done 35 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" 40 ''; 41 42 postInstall = '' 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 46 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 50 51 patchShebangs $out/bin/* 52 ''; 53 54 doCheck = false; 55 pythonImportsCheck = [ "google_compute_engine" ]; 56 57 meta = with lib; { 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; 63 }; 64}