uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
58
pkgs/tools/virtualization/google-guest-oslogin/default.nix
Normal file
58
pkgs/tools/virtualization/google-guest-oslogin/default.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, bashInteractive
|
||||
, curl
|
||||
, fetchFromGitHub
|
||||
, json_c
|
||||
, nixosTests
|
||||
, pam
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "google-guest-oslogin";
|
||||
version = "20220205.00";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "GoogleCloudPlatform";
|
||||
repo = "guest-oslogin";
|
||||
rev = version;
|
||||
sha256 = "sha256-CVJAWda8bn5MPO8ACLtosVvZzuxPbOj377WaysZdhDU=";
|
||||
};
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue