10 stdenv.mkDerivation rec {
11 pname = "google-guest-oslogin";
12 version = "20230831.00";
14 src = fetchFromGitHub {
15 owner = "GoogleCloudPlatform";
16 repo = "guest-oslogin";
18 sha256 = "sha256-9QCB94HVbeLjioJuSN1Aa+EqFncojPoWFxw5mS9bDGw=";
22 # change sudoers dir from /var/google-sudoers.d to /run/google-sudoers.d (managed through systemd-tmpfiles)
23 substituteInPlace src/pam/pam_oslogin_admin.cc --replace /var/google-sudoers.d /run/google-sudoers.d
24 # fix "User foo not allowed because shell /bin/bash does not exist"
25 substituteInPlace src/include/compat.h --replace /bin/bash /run/current-system/sw/bin/bash
28 buildInputs = [ curl.dev pam json_c ];
30 env.NIX_CFLAGS_COMPILE = toString [ "-I${json_c.dev}/include/json-c" ];
35 "MANDIR=$(out)/share/man"
36 "SYSTEMDDIR=$(out)/etc/systemd/system"
37 "PRESETDIR=$(out)/etc/systemd/system-preset"
41 sed -i "s,/usr/bin/,$out/bin/,g" $out/etc/systemd/system/google-oslogin-cache.service
44 enableParallelBuilding = true;
47 inherit (nixosTests) google-oslogin;
51 homepage = "https://github.com/GoogleCloudPlatform/compute-image-packages";
52 description = "OS Login Guest Environment for Google Compute Engine";
53 license = licenses.asl20;
54 platforms = platforms.linux;
55 maintainers = with maintainers; [ flokli ];