13 pname = "guest-agent";
14 version = "20230821.00";
16 src = fetchFromGitHub {
17 owner = "GoogleCloudPlatform";
19 rev = "refs/tags/${version}";
20 hash = "sha256-DP15KDnD09edBxOQDwP0cjVIFxjMzE1hu1Sbu6Faj9Y=";
23 vendorHash = "sha256-PGvyDjhLwIKhR6NmwzbzjfkBK+FqsziAdsybQmCbtCc=";
25 patches = [ ./disable-etc-mutation.patch ];
27 nativeBuildInputs = [ makeWrapper ];
30 substitute ${./fix-paths.patch} fix-paths.patch \
32 --subst-var-by true "${coreutils}/bin/true"
33 patch -p1 < ./fix-paths.patch
36 # We don't add `shadow` here; it's added to PATH if `mutableUsers` is enabled.
37 binPath = lib.makeBinPath [
44 # Skip tests which require networking.
46 rm google_guest_agent/wsfc_test.go
50 mkdir -p $out/etc/systemd/system
51 cp *.service $out/etc/systemd/system
52 install -Dm644 instance_configs.cfg $out/etc/default/instance_configs.cfg
54 wrapProgram $out/bin/google_guest_agent \
55 --prefix PATH ":" "$binPath"
59 description = "Guest Agent for Google Compute Engine";
60 homepage = "https://github.com/GoogleCloudPlatform/guest-agent";
61 changelog = "https://github.com/GoogleCloudPlatform/guest-agent/releases/tag/${version}";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ abbradar ];
64 platforms = platforms.linux;