Commit bd4c69da authored by Fernando Rodrigues's avatar Fernando Rodrigues Committed by Alyssa Ross
Browse files

xen-guest-agent: install systemd service



Upstream provides a minimal systemd service that initialises the
xen-guest-agent binary. This will be useful for anyone who makes a NixOS
module for this package.

Also adds a comment to postFixup.

Signed-off-by: default avatarFernando Rodrigues <alpha@sigmasquadron.net>
parent 1d11eba6
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -27,11 +27,19 @@ rustPlatform.buildRustPackage rec {

  buildInputs = [ xen-slim ];


  postFixup = ''
    patchelf $out/bin/xen-guest-agent --add-rpath ${xen-slim.out}/lib
  postInstall =
    # Install the sample systemd service.
    ''
      mkdir --parents $out/lib/systemd/system
      cp $src/startup/xen-guest-agent.service $out/lib/systemd/system
      substituteInPlace $out/lib/systemd/system/xen-guest-agent.service \
        --replace-fail "/usr/sbin/xen-guest-agent" "$out/bin/xen-guest-agent"
    '';

  postFixup =
    # Add the Xen libraries in the runpath so the guest agent can find libxenstore.
    "patchelf $out/bin/xen-guest-agent --add-rpath ${xen-slim.out}/lib";

  meta = {
    description = "Xen agent running in Linux/BSDs (POSIX) VMs";
    homepage = "https://gitlab.com/xen-project/xen-guest-agent";