biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / virtualization / google-guest-agent / default.nix
blob423f43a02de03fbd3fddc7e27d2529074e8ceab4
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , coreutils
5 , makeWrapper
6 , google-guest-configs
7 , google-guest-oslogin
8 , iproute2
9 , procps
12 buildGoModule rec {
13   pname = "guest-agent";
14   version = "20230821.00";
16   src = fetchFromGitHub {
17     owner = "GoogleCloudPlatform";
18     repo = pname;
19     rev = "refs/tags/${version}";
20     hash = "sha256-DP15KDnD09edBxOQDwP0cjVIFxjMzE1hu1Sbu6Faj9Y=";
21   };
23   vendorHash = "sha256-PGvyDjhLwIKhR6NmwzbzjfkBK+FqsziAdsybQmCbtCc=";
25   patches = [ ./disable-etc-mutation.patch ];
27   nativeBuildInputs = [ makeWrapper ];
29   postPatch = ''
30     substitute ${./fix-paths.patch} fix-paths.patch \
31       --subst-var out \
32       --subst-var-by true "${coreutils}/bin/true"
33     patch -p1 < ./fix-paths.patch
34   '';
36   # We don't add `shadow` here; it's added to PATH if `mutableUsers` is enabled.
37   binPath = lib.makeBinPath [
38     google-guest-configs
39     google-guest-oslogin
40     iproute2
41     procps
42   ];
44   # Skip tests which require networking.
45   preCheck = ''
46     rm google_guest_agent/wsfc_test.go
47   '';
49   postInstall = ''
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"
56   '';
58   meta = with lib; {
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;
65   };