summary refs log tree commit diff
path: root/pkgs/tools/virtualization
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-04-01 14:01:41 +0200
committerFlorian Klink <flokli@flokli.de>2020-04-29 14:36:35 +0200
commit5506463c2f63a9a111191de97aab0ef9c3d87124 (patch)
tree0dce7e36218e6ed7035c4a11618141b424cf6033 /pkgs/tools/virtualization
parentcffb1cbcb24b36aa94320032007fda2b12d69d39 (diff)
downloadnixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.tar
nixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.tar.gz
nixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.tar.bz2
nixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.tar.lz
nixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.tar.xz
nixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.tar.zst
nixpkgs-5506463c2f63a9a111191de97aab0ef9c3d87124.zip
google-compute-engine-oslogin: 1.5.3 -> 20200325.00
Google moved their oslogin guest tools to another repository.
Point src to there, and bump to the latest version
There's now a Makefile, so we can avoid having our own custom
installPhase, and we also get manpages.

I successfully ran the oslogin tests, so assuming the google cloud
metadata server still behaves like in our test, logins should work.
I saw a nscd segfault, not sure if it's caused by this or was already
the case before.
It'd be great if someone could test this on an actual VM.
Diffstat (limited to 'pkgs/tools/virtualization')
-rw-r--r--pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix33
1 files changed, 16 insertions, 17 deletions
diff --git a/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix b/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix
index 31ea1cb2a94..2c2444de4e5 100644
--- a/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix
+++ b/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , curl
 , json_c
@@ -8,22 +9,20 @@
 
 stdenv.mkDerivation rec {
   pname = "google-compute-engine-oslogin";
-  version = "1.5.3";
-  # from packages/google-compute-engine-oslogin/packaging/debian/changelog
+  version = "20200325.00";
 
   src = fetchFromGitHub {
     owner = "GoogleCloudPlatform";
-    repo = "compute-image-packages";
-    rev = "20190522";
-    sha256 = "16jbbrnz49g843h813r408dbvfa2hicf8canxwbfxr2kzhv7ycmm";
+    repo = "guest-oslogin";
+    rev = version;
+    sha256 = "03hk95pgzcgy6ginp8zdy0fbk88m6n65qq22jq490z1xwbjffm8r";
   };
-  sourceRoot = "source/packages/google-compute-engine-oslogin";
 
   postPatch = ''
     # change sudoers dir from /var/google-sudoers.d to /run/google-sudoers.d (managed through systemd-tmpfiles)
-    substituteInPlace pam_module/pam_oslogin_admin.cc --replace /var/google-sudoers.d /run/google-sudoers.d
+    substituteInPlace src/pam/pam_oslogin_admin.cc --replace /var/google-sudoers.d /run/google-sudoers.d
     # fix "User foo not allowed because shell /bin/bash does not exist"
-    substituteInPlace compat.h --replace /bin/bash ${bashInteractive}/bin/bash
+    substituteInPlace src/include/compat.h --replace /bin/bash ${bashInteractive}/bin/bash
   '';
 
   buildInputs = [ curl.dev pam ];
@@ -31,15 +30,15 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE="-I${json_c.dev}/include/json-c";
   NIX_CFLAGS_LINK="-L${json_c}/lib";
 
-  installPhase = ''
-    mkdir -p $out/{bin,lib}
-
-    install -Dm755 libnss_cache_google-compute-engine-oslogin-${version}.so $out/lib/libnss_cache_oslogin.so.2
-    install -Dm755 libnss_google-compute-engine-oslogin-${version}.so $out/lib/libnss_oslogin.so.2
-
-    install -Dm755 pam_oslogin_admin.so pam_oslogin_login.so $out/lib
-    install -Dm755 google_{oslogin_nss_cache,authorized_keys} $out/bin
-  '';
+  makeFlags = [
+    "VERSION=${version}"
+    "DESTDIR=${placeholder "out"}"
+    "PREFIX=/"
+    "BINDIR=/bin"
+    "LIBDIR=/lib"
+    "PAMDIR=/lib"
+    "MANDIR=/share/man"
+  ];
 
   enableParallelBuilding = true;