Skip to content

Commit

Permalink
xen-guest-agent: install systemd service
Browse files Browse the repository at this point in the history
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: Fernando Rodrigues <alpha@sigmasquadron.net>
  • Loading branch information
SigmaSquadron authored and alyssais committed Aug 19, 2024
1 parent 1d11eba commit bd4c69d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkgs/by-name/xe/xen-guest-agent/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ rustPlatform.buildRustPackage rec {

buildInputs = [ xen-slim ];

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 = ''
patchelf $out/bin/xen-guest-agent --add-rpath ${xen-slim.out}/lib
'';
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";
Expand Down

0 comments on commit bd4c69d

Please sign in to comment.