1 { stdenv, lib, fetchFromGitHub, makeWrapper
2 , ipcalc, iproute2, util-linux, coreutils, ethtool, gnugrep, gnused, nvme-cli }:
4 stdenv.mkDerivation rec {
5 pname = "google-guest-configs";
6 version = "20211116.00";
8 src = fetchFromGitHub {
9 owner = "GoogleCloudPlatform";
10 repo = "guest-configs";
12 sha256 = "sha256-0SRu6p/DsHNNI20mkXJitt/Ee5S2ooiy5hNmD+ndecM=";
15 binDeps = lib.makeBinPath [ coreutils util-linux gnugrep gnused ethtool ipcalc iproute2 ];
17 nativeBuildInputs = [ makeWrapper ];
23 substitute ${./fix-paths.patch} fix-paths.patch \
25 --subst-var-by nvme "${nvme-cli}/bin/nvme" \
26 --subst-var-by sh "${stdenv.shell}" \
27 --subst-var-by umount "${util-linux}/bin/umount" \
28 --subst-var-by logger "${util-linux}/bin/logger"
29 patch -p1 < ./fix-paths.patch
33 mkdir -p $out/{bin,etc,lib}
34 cp -r src/etc/{modprobe.d,sysctl.d} $out/etc
35 cp -r src/lib/udev $out/lib
36 cp -r src/sbin/* $out/bin
37 cp -r src/usr/bin/* $out/bin
39 for i in $out/bin/* $out/lib/udev/google_nvme_id; do
41 --prefix "PATH" ":" "$binDeps"
46 homepage = "https://github.com/GoogleCloudPlatform/guest-configs";
47 description = "Linux Guest Environment for Google Compute Engine";
48 license = licenses.asl20;
49 platforms = platforms.linux;
50 maintainers = with maintainers; [ abbradar ];