From 077d0524ccfec44c00b469833ad7b5d8a984e7f6 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Mon, 10 Jan 2022 16:39:16 +0300 Subject: google-compute-engine-oslogin: 20210429.00 -> 20211213.00 * Rename to google-guest-oslogin; * Fix systemd service; * Small cleanup. --- .../google-compute-engine-oslogin/default.nix | 56 --------------------- .../google-guest-oslogin/default.nix | 58 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 56 deletions(-) delete mode 100644 pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix create mode 100644 pkgs/tools/virtualization/google-guest-oslogin/default.nix (limited to 'pkgs/tools/virtualization') diff --git a/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix b/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix deleted file mode 100644 index 0718e437b06..00000000000 --- a/pkgs/tools/virtualization/google-compute-engine-oslogin/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ stdenv -, lib -, bashInteractive -, curl -, fetchFromGitHub -, json_c -, nixosTests -, pam -}: - -stdenv.mkDerivation rec { - pname = "google-compute-engine-oslogin"; - version = "20210429.00"; - - src = fetchFromGitHub { - owner = "GoogleCloudPlatform"; - repo = "guest-oslogin"; - rev = version; - sha256 = "eHAg9K5oxcygEzqaac81jSFHF+zsW6uB7q2Kfo9hSrA="; - }; - - 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 - ''; - - buildInputs = [ curl.dev pam ]; - - NIX_CFLAGS_COMPILE = "-I${json_c.dev}/include/json-c"; - NIX_CFLAGS_LINK = "-L${json_c}/lib"; - - makeFlags = [ - "VERSION=${version}" - "DESTDIR=${placeholder "out"}" - "PREFIX=/" - "BINDIR=/bin" - "LIBDIR=/lib" - "PAMDIR=/lib" - "MANDIR=/share/man" - ]; - - enableParallelBuilding = true; - - passthru.tests = { - inherit (nixosTests) google-oslogin; - }; - - meta = with lib; { - homepage = "https://github.com/GoogleCloudPlatform/compute-image-packages"; - description = "OS Login Guest Environment for Google Compute Engine"; - license = licenses.asl20; - maintainers = with maintainers; [ flokli ]; - }; -} diff --git a/pkgs/tools/virtualization/google-guest-oslogin/default.nix b/pkgs/tools/virtualization/google-guest-oslogin/default.nix new file mode 100644 index 00000000000..6dceeecfd6e --- /dev/null +++ b/pkgs/tools/virtualization/google-guest-oslogin/default.nix @@ -0,0 +1,58 @@ +{ stdenv +, lib +, bashInteractive +, curl +, fetchFromGitHub +, json_c +, nixosTests +, pam +}: + +stdenv.mkDerivation rec { + pname = "google-guest-oslogin"; + version = "20211213.00"; + + src = fetchFromGitHub { + owner = "GoogleCloudPlatform"; + repo = "guest-oslogin"; + rev = version; + 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 /run/current-system/sw/bin/bash + ''; + + buildInputs = [ curl.dev pam json_c ]; + + NIX_CFLAGS_COMPILE = [ "-I${json_c.dev}/include/json-c" ]; + + makeFlags = [ + "VERSION=${version}" + "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 = { + inherit (nixosTests) google-oslogin; + }; + + meta = with lib; { + 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 ]; + }; +} -- cgit 1.4.1