diff options
author | Fernando Rodrigues | 2024-08-18 16:59:15 +0000 |
---|---|---|
committer | Alyssa Ross | 2024-08-19 08:16:37 +0200 |
commit | bd4c69da51be8319f0b7fe25e98abab5b6a30fa9 (patch) | |
tree | 6d38c968e5feeaa8286bfcc49fcf88a6e270ebe9 /pkgs/by-name/xe | |
parent | 1d11eba657623a14e752975539d2a69b1d5039ff (diff) |
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: Fernando Rodrigues <alpha@sigmasquadron.net>
Diffstat (limited to 'pkgs/by-name/xe')
-rw-r--r-- | pkgs/by-name/xe/xen-guest-agent/package.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/by-name/xe/xen-guest-agent/package.nix b/pkgs/by-name/xe/xen-guest-agent/package.nix index 55ecf68429e3..9375b0d47656 100644 --- a/pkgs/by-name/xe/xen-guest-agent/package.nix +++ b/pkgs/by-name/xe/xen-guest-agent/package.nix @@ -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"; |