1 { lib, fetchFromGitHub, python3, intltool, file, wrapGAppsHook3, gtk-vnc
2 , vte, avahi, dconf, gobject-introspection, libvirt-glib, system-libvirt
3 , gsettings-desktop-schemas, gst_all_1, libosinfo, adwaita-icon-theme, gtksourceview4, docutils, cpio
4 , e2fsprogs, findutils, gzip, cdrtools, xorriso, fetchpatch
5 , desktopToDarwinBundle, stdenv
6 , spiceSupport ? true, spice-gtk ? null
9 python3.pkgs.buildPythonApplication rec {
10 pname = "virt-manager";
13 src = fetchFromGitHub {
17 hash = "sha256-UgZ58WLXq0U3EDt4311kv0kayVU17In4kwnQ+QN1E7A=";
21 # refresh Fedora tree URLs in virt-install-osinfo* expected XMLs
23 url = "https://github.com/virt-manager/virt-manager/commit/6e5c1db6b4a0af96afeb09a09fb2fc2b73308f01.patch";
24 hash = "sha256-zivVo6nHvfB7aHadOouQZCBXn5rY12nxFjQ4FFwjgZI=";
26 # fix test with libvirt 10
28 url = "https://github.com/virt-manager/virt-manager/commit/83fcc5b2e8f2cede84564387756fe8971de72188.patch";
29 hash = "sha256-yEk+md5EkwYpP27u3E+oTJ8thgtH2Uy1x3JIWPBhqeE=";
31 # fix crash with some cursor themes
33 url = "https://github.com/virt-manager/virt-manager/commit/cc4a39ea94f42bc92765eb3bb56e2b7f9198be67.patch";
34 hash = "sha256-dw6yrMaAOnTh8Z6xJQQKmYelOkOl6EBAOfJQU9vQ8Ws=";
36 # fix xml test output mismatch
38 url = "https://github.com/virt-manager/virt-manager/commit/8b6db203f726965529567459b302aab1c68c70eb.patch";
39 hash = "sha256-FghrSyP4NaTkJhvyqlc2uDNWKaeiylKnaiqkl5Ax6yE=";
45 gobject-introspection # for setup hook populating GI_TYPELIB_PATH
48 ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
51 gst_all_1.gst-plugins-base
52 gst_all_1.gst-plugins-good
53 libvirt-glib vte dconf gtk-vnc adwaita-icon-theme avahi
54 gsettings-desktop-schemas libosinfo gtksourceview4
55 ] ++ lib.optional spiceSupport spice-gtk;
57 dependencies = with python3.pkgs; [
58 pygobject3 libvirt libxml2 requests cdrtools
62 sed -i 's|/usr/share/libvirt/cpu_map.xml|${system-libvirt}/share/libvirt/cpu_map.xml|g' virtinst/capabilities.py
63 sed -i "/'install_egg_info'/d" setup.py
67 ${python3.interpreter} setup.py configure --prefix=$out
70 setupPyGlobalFlags = [ "--no-update-icon-cache" "--no-compile-schemas" ];
75 glib-compile-schemas $out/share/gsettings-schemas/${pname}-${version}/glib-2.0/schemas
77 gappsWrapperArgs+=(--set PYTHONPATH "${python3.pkgs.makePythonPath dependencies}")
78 # these are called from virt-install in initrdinject.py
79 gappsWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ cpio e2fsprogs file findutils gzip ]}")
81 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
83 # Fixes testCLI0051virt_install_initrd_inject on Darwin: "cpio: root:root: invalid group"
84 substituteInPlace virtinst/install/installerinject.py \
85 --replace "'--owner=root:root'" "'--owner=0:0'"
88 nativeCheckInputs = with python3.pkgs; [
97 "test_misc_nonpredicatble_generate"
98 "test_disk_dir_searchable" # does something strange with permissions
99 "testCLI0001virt_install_many_devices" # expects /var to exist
103 export HOME=$(mktemp -d)
104 ''; # <- Required for "tests/test_urldetect.py".
107 $out/bin/virt-manager --version | grep -Fw ${version} > /dev/null
111 homepage = "https://virt-manager.org";
112 description = "Desktop user interface for managing virtual machines";
114 The virt-manager application is a desktop user interface for managing
115 virtual machines through libvirt. It primarily targets KVM VMs, but also
116 manages Xen and LXC (linux containers).
118 license = licenses.gpl2;
119 platforms = platforms.unix;
120 mainProgram = "virt-manager";
121 maintainers = with maintainers; [ qknight offline fpletz globin ];