From 10f5f8c5d8036f5eac629df7939ed5e6c1bcabbb Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 1 Sep 2019 00:27:56 +0200 Subject: google-compute-engine: patch shebangs in $out/bin, properly patch systemctl --- pkgs/tools/virtualization/google-compute-engine/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pkgs') diff --git a/pkgs/tools/virtualization/google-compute-engine/default.nix b/pkgs/tools/virtualization/google-compute-engine/default.nix index 5abdcc23a74cc..d4c817b7ecb7d 100644 --- a/pkgs/tools/virtualization/google-compute-engine/default.nix +++ b/pkgs/tools/virtualization/google-compute-engine/default.nix @@ -22,13 +22,16 @@ buildPythonApplication rec { sha256 = "08cy0jd463kng6hwbd3nfldsp4dpd2lknlvdm88cq795wy0kh4wp"; }; + buildInputs = [ bash ]; + propagatedBuildInputs = [ boto setuptools distro ]; + + postPatch = '' for file in $(find google_compute_engine -type f); do substituteInPlace "$file" \ - --replace /bin/systemctl "${systemd}/bin/systemctl" \ + --replace /bin/systemctl "/run/current-system/sw/bin/systemctl" \ --replace /bin/bash "${bashInteractive}/bin/bash" \ --replace /sbin/hwclock "${utillinux}/bin/hwclock" - # SELinux tool ??? /sbin/restorecon done @@ -42,9 +45,9 @@ buildPythonApplication rec { # 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 ]; + patchShebangs $out/bin/* + ''; doCheck = false; -- cgit 1.4.1