mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/libvirtd: support out-of-tree vhost-user drivers
Add an option allowing packages containing out-of-tree vhost-user drivers for QEMU to be specified. The relevant configurations are then linked at runtime where libvirt expects them. An example use case for this is virtiofs.
This commit is contained in:
parent
62c8b51c27
commit
77e5fa5ea6
1 changed files with 17 additions and 0 deletions
|
@ -116,6 +116,15 @@ let
|
||||||
QEMU's swtpm options.
|
QEMU's swtpm options.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vhostUserPackages = mkOption {
|
||||||
|
type = types.listOf types.package;
|
||||||
|
default = [ ];
|
||||||
|
example = lib.literalExpression "[ pkgs.virtiofsd ]";
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Packages containing out-of-tree vhost-user drivers.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -502,6 +511,14 @@ in
|
||||||
# https://libvirt.org/daemons.html#monolithic-systemd-integration
|
# https://libvirt.org/daemons.html#monolithic-systemd-integration
|
||||||
systemd.sockets.libvirtd.wantedBy = [ "sockets.target" ];
|
systemd.sockets.libvirtd.wantedBy = [ "sockets.target" ];
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = let
|
||||||
|
vhostUserCollection = pkgs.buildEnv {
|
||||||
|
name = "vhost-user";
|
||||||
|
paths = cfg.qemu.vhostUserPackages;
|
||||||
|
pathsToLink = [ "/share/qemu/vhost-user" ];
|
||||||
|
};
|
||||||
|
in [ "L+ /var/lib/qemu/vhost-user - - - - ${vhostUserCollection}/share/qemu/vhost-user" ];
|
||||||
|
|
||||||
security.polkit = {
|
security.polkit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue