Skip to content

Commit

Permalink
google-compute-engine-oslogin: 20210429.00 -> 20211213.00
Browse files Browse the repository at this point in the history
* Rename to google-guest-oslogin;
* Fix systemd service;
* Small cleanup.
  • Loading branch information
abbradar committed Feb 5, 2022
1 parent c3f278b commit 077d052
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,39 @@
}:

stdenv.mkDerivation rec {
pname = "google-compute-engine-oslogin";
version = "20210429.00";
pname = "google-guest-oslogin";
version = "20211213.00";

src = fetchFromGitHub {
owner = "GoogleCloudPlatform";
repo = "guest-oslogin";
rev = version;
sha256 = "eHAg9K5oxcygEzqaac81jSFHF+zsW6uB7q2Kfo9hSrA=";
sha256 = "sha256-8RuLYdWfk8zPfoF06r5E/6eHQ7tziZbgGhZlLCUW600=";
};

postPatch = ''
# change sudoers dir from /var/google-sudoers.d to /run/google-sudoers.d (managed through systemd-tmpfiles)
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 src/include/compat.h --replace /bin/bash ${bashInteractive}/bin/bash
substituteInPlace src/include/compat.h --replace /bin/bash /run/current-system/sw/bin/bash
'';

buildInputs = [ curl.dev pam ];
buildInputs = [ curl.dev pam json_c ];

NIX_CFLAGS_COMPILE = "-I${json_c.dev}/include/json-c";
NIX_CFLAGS_LINK = "-L${json_c}/lib";
NIX_CFLAGS_COMPILE = [ "-I${json_c.dev}/include/json-c" ];

makeFlags = [
"VERSION=${version}"
"DESTDIR=${placeholder "out"}"
"PREFIX=/"
"BINDIR=/bin"
"LIBDIR=/lib"
"PAMDIR=/lib"
"MANDIR=/share/man"
"PREFIX=$(out)"
"MANDIR=$(out)/share/man"
"SYSTEMDDIR=$(out)/etc/systemd/system"
"PRESETDIR=$(out)/etc/systemd/system-preset"
];

postInstall = ''
sed -i "s,/usr/bin/,$out/bin/,g" $out/etc/systemd/system/google-oslogin-cache.service
'';

enableParallelBuilding = true;

passthru.tests = {
Expand All @@ -51,6 +52,7 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/GoogleCloudPlatform/compute-image-packages";
description = "OS Login Guest Environment for Google Compute Engine";
license = licenses.asl20;
platforms = platforms.linux;
maintainers = with maintainers; [ flokli ];
};
}
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6103,7 +6103,7 @@ with pkgs;

google-compute-engine = with python38.pkgs; toPythonApplication google-compute-engine;

google-compute-engine-oslogin = callPackage ../tools/virtualization/google-compute-engine-oslogin { };
google-guest-oslogin = callPackage ../tools/virtualization/google-guest-oslogin { };

google-cloud-cpp = callPackage ../development/libraries/google-cloud-cpp { };

Expand Down

0 comments on commit 077d052

Please sign in to comment.