about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/virtualization/google-compute-engine
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/virtualization/google-compute-engine')
-rw-r--r--nixpkgs/pkgs/tools/virtualization/google-compute-engine/default.nix17
1 files changed, 12 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/tools/virtualization/google-compute-engine/default.nix b/nixpkgs/pkgs/tools/virtualization/google-compute-engine/default.nix
index 0db43ccfcfdd..48255ca68a73 100644
--- a/nixpkgs/pkgs/tools/virtualization/google-compute-engine/default.nix
+++ b/nixpkgs/pkgs/tools/virtualization/google-compute-engine/default.nix
@@ -11,7 +11,7 @@
 }:
 
 buildPythonApplication rec {
-  name = "google-compute-engine-${version}";
+  pname = "google-compute-engine";
   version = "20190124";
   namePrefix = "";
 
@@ -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,13 @@ 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 ];
+    # 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;