libvirt: fix iscsi storage support

Turns out, I was testing #42545 in a nix-shell and forgot how it handles dependencies different from environments.
This commit is contained in:
ajs124 2018-06-26 12:17:04 +02:00
parent b8ffd2459d
commit 3f9d968637

View file

@ -93,7 +93,10 @@ in stdenv.mkDerivation rec {
"sysconfdir=$(out)/var/lib"
];
postInstall = ''
postInstall = let
binPath = [ iptables iproute pmutils numad numactl bridge-utils dmidecode dnsmasq ebtables ] ++ optionals enableIscsi [ openiscsi ];
in ''
substituteInPlace $out/libexec/libvirt-guests.sh \
--replace 'ON_SHUTDOWN=suspend' 'ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}' \
--replace "$out/bin" '${gettext}/bin' \
@ -106,7 +109,7 @@ in stdenv.mkDerivation rec {
substituteInPlace $out/lib/systemd/system/libvirtd.service --replace /bin/kill ${coreutils}/bin/kill
rm $out/lib/systemd/system/{virtlockd,virtlogd}.*
wrapProgram $out/sbin/libvirtd \
--prefix PATH : /run/libvirt/nix-emulators:${makeBinPath [ iptables iproute pmutils numad numactl bridge-utils dmidecode dnsmasq ebtables ]}
--prefix PATH : /run/libvirt/nix-emulators:${makeBinPath binPath}
'';
enableParallelBuilding = true;