git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #18567 (VirtualBox 5.1.6)

This introduces VirtualBox version 5.1.6 along with a few refactored stuff, notably: * Kernel modules and user space applications are now separate derivations. * If config.pulseaudio doesn't exist in nixpkgs config, the default is now to build with PulseAudio modules. * A new updater to keep VirtualBox up to date. All subtests in nixos/tests/virtualbox.nix succeed on my machine and VirtualBox was reported to be working by @DamienCassou (although with unrelated audio problems for another fix/branch) and @calbrecht.

commit1781e955779397e4c39d406909823841210df962 authoraszlig <aszlig@redmoonstudios.org> dateWed 14 Sep 2016, 02:20 (10 years ago) parent3efebb1f7563ef
12 files changed+267−72
nixos/doc/manual/release-notes/rl-1609.xml+9 nixos/modules/virtualisation/virtualbox-host.nix+7−2 nixos/modules/virtualisation/virtualbox-image.nix+1−1 nixos/tests/virtualbox.nix+10−3 pkgs/applications/virtualization/virtualbox/default.nix+26−50 pkgs/applications/virtualization/virtualbox/guest-additions/default.nix+1−1 pkgs/applications/virtualization/virtualbox/libressl.patch+47 pkgs/applications/virtualization/virtualbox/qtx11extras.patch+31 pkgs/applications/virtualization/virtualbox/update.py+83 pkgs/applications/virtualization/virtualbox/upstream-info.json+8 pkgs/os-specific/linux/virtualbox/default.nix+23 pkgs/top-level/all-packages.nix+21−15
nixos/doc/manual/release-notes/rl-1609.xml+9
@@ -90,6 +90,15 @@ following incompatible changes:</para>
9090 Use <literal>security.audit.enable = true;</literal> to explicitly enable it.</para>
9191 </listitem>
9292
93+ <listitem>
94+ <para>
95+ <literal>pkgs.linuxPackages.virtualbox</literal> now contains only the
96+ kernel modules instead of the VirtualBox user space binaries.
97+ If you want to reference the user space binaries, you have to use the new
98+ <literal>pkgs.virtualbox</literal> instead.
99+ </para>
100+ </listitem>
101+
93102</itemizedlist>
94103
95104
nixos/modules/virtualisation/virtualbox-host.nix+7−2
@@ -4,10 +4,15 @@ with lib;
44
55let
66 cfg = config.virtualisation.virtualbox.host;
7− virtualbox = config.boot.kernelPackages.virtualbox.override {
7+
8+ virtualbox = pkgs.virtualbox.override {
89 inherit (cfg) enableHardening headless;
910 };
1011
12+ kernelModules = config.boot.kernelPackages.virtualbox.override {
13+ inherit virtualbox;
14+ };
15+
1116in
1217
1318{
@@ -60,7 +65,7 @@ in
6065
6166 config = mkIf cfg.enable (mkMerge [{
6267 boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ];
63− boot.extraModulePackages = [ virtualbox ];
68+ boot.extraModulePackages = [ kernelModules ];
6469 environment.systemPackages = [ virtualbox ];
6570
6671 security.setuidOwners = let
nixos/modules/virtualisation/virtualbox-image.nix+1−1
@@ -34,7 +34,7 @@ in {
3434 postVM =
3535 ''
3636 export HOME=$PWD
37− export PATH=${pkgs.linuxPackages.virtualbox}/bin:$PATH
37+ export PATH=${pkgs.virtualbox}/bin:$PATH
3838
3939 echo "creating VirtualBox pass-through disk wrapper (no copying invovled)..."
4040 VBoxManage internalcommands createrawvmdk -filename disk.vmdk -rawdisk $diskImage
nixos/tests/virtualbox.nix+10−3
@@ -144,6 +144,7 @@ let
144144 "--uart1 0x3F8 4"
145145 "--uartmode1 client /run/virtualbox-log-${name}.sock"
146146 "--memory 768"
147+ "--audio none"
147148 ] ++ (attrs.vmFlags or []));
148149
149150 controllerFlags = mkFlags [
@@ -273,9 +274,12 @@ let
273274
274275 sub shutdownVM_${name} {
275276 $machine->succeed(ru "touch ${sharePath}/shutdown");
276− $machine->waitUntilSucceeds(
277− "test ! -e ${sharePath}/shutdown ".
278− " -a ! -e ${sharePath}/boot-done"
277+ $machine->execute(
278+ 'set -e; i=0; '.
279+ 'while test -e ${sharePath}/shutdown '.
280+ ' -o -e ${sharePath}/boot-done; do '.
281+ 'sleep 1; i=$(($i + 1)); [ $i -le 3600 ]; '.
282+ 'done'
279283 );
280284 waitForShutdown_${name};
281285 }
@@ -386,6 +390,7 @@ in mapAttrs mkVBoxTest {
386390 $machine->sendKeys("ctrl-q");
387391 $machine->sleep(5);
388392 $machine->screenshot("gui_manager_stopped");
393+ destroyVM_simple;
389394 '';
390395
391396 simple-cli = ''
@@ -403,6 +408,7 @@ in mapAttrs mkVBoxTest {
403408 });
404409
405410 shutdownVM_simple;
411+ destroyVM_simple;
406412 '';
407413
408414 headless = ''
@@ -411,6 +417,7 @@ in mapAttrs mkVBoxTest {
411417 waitForStartup_headless;
412418 waitForVMBoot_headless;
413419 shutdownVM_headless;
420+ destroyVM_headless;
414421 '';
415422
416423 host-usb-permissions = ''
pkgs/applications/virtualization/virtualbox/default.nix+26−50
@@ -1,8 +1,8 @@
11{ stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
2−, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernel, lvm2
3−, libXrandr
2+, libXcursor, libXmu, qt5, libIDL, SDL, libcap, zlib, libpng, glib, lvm2
3+, libXrandr, libXinerama
44, which, alsaLib, curl, libvpx, gawk, nettools, dbus
5−, xorriso, makeself, perl, pkgconfig, nukeReferences
5+, xorriso, makeself, perl, pkgconfig
66, javaBindings ? false, jdk ? null
77, pythonBindings ? false, python ? null
88, enableExtensionPack ? false, requireFile ? null, patchelf ? null, fakeroot ? null
@@ -16,37 +16,12 @@ with stdenv.lib;
1616let
1717 buildType = "release";
1818
19− # When changing this, update ./guest-additions and the extpack
20− # revision/hash as well. See
21− # http://download.virtualbox.org/virtualbox/${version}/SHA256SUMS
22− # for hashes.
23− version = "5.0.26";
24−
25− forEachModule = action: ''
26− for mod in \
27− out/linux.*/${buildType}/bin/src/vboxdrv \
28− out/linux.*/${buildType}/bin/src/vboxpci \
29− out/linux.*/${buildType}/bin/src/vboxnetadp \
30− out/linux.*/${buildType}/bin/src/vboxnetflt
31− do
32− if [ "x$(basename "$mod")" != xvboxdrv -a ! -e "$mod/Module.symvers" ]
33− then
34− cp -v out/linux.*/${buildType}/bin/src/vboxdrv/Module.symvers \
35− "$mod/Module.symvers"
36− fi
37− INSTALL_MOD_PATH="$out" INSTALL_MOD_DIR=misc \
38− make -j $NIX_BUILD_CORES -C "$MODULES_BUILD_DIR" DEPMOD=/do_not_use_depmod \
39− "M=\$(PWD)/$mod" BUILD_TYPE="${buildType}" ${action}
40− done
41− '';
19+ inherit (importJSON ./upstream-info.json) version extpackRev extpack main;
4220
4321 # See https://github.com/NixOS/nixpkgs/issues/672 for details
44− extpackRevision = "108824";
4522 extensionPack = requireFile rec {
46− name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRevision}.vbox-extpack";
47− # IMPORTANT: Hash must be base16 encoded because it's used as an input to
48− # VBoxExtPackHelperApp!
49− sha256 = "2f2302c7ba3d00a1258fe8e7767a6eb08dccdc3c31f6e3eeb74063c2c268b104";
23+ name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRev}.vbox-extpack";
24+ sha256 = extpack;
5025 message = ''
5126 In order to use the extension pack, you need to comply with the VirtualBox Personal Use
5227 and Evaluation License (PUEL) available at:
@@ -61,35 +36,36 @@ let
6136 };
6237
6338in stdenv.mkDerivation {
64− name = "virtualbox-${version}-${kernel.version}";
39+ name = "virtualbox-${version}";
6540
6641 src = fetchurl {
6742 url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
68− sha256 = "78dec1369d2c8feefea3c682d95e76c0e99414c56626388035cf4061d4dad62e";
43+ sha256 = main;
6944 };
7045
46+ outputs = [ "out" "modsrc" ];
47+
7148 buildInputs =
7249 [ iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor libIDL
7350 libcap glib lvm2 python alsaLib curl libvpx pam xorriso makeself perl
74− pkgconfig which libXmu nukeReferences ]
51+ pkgconfig which libXmu libpng ]
7552 ++ optional javaBindings jdk
7653 ++ optional pythonBindings python
7754 ++ optional pulseSupport libpulseaudio
78− ++ optionals (headless) [ libXrandr libpng ]
79− ++ optionals (!headless) [ qt4 SDL ];
55+ ++ optionals (headless) [ libXrandr ]
56+ ++ optionals (!headless) [ qt5.qtbase qt5.qtx11extras libXinerama SDL ];
8057
8158 hardeningDisable = [ "fortify" "pic" "stackprotector" ];
8259
8360 prePatch = ''
8461 set -x
85− MODULES_BUILD_DIR=`echo ${kernel.dev}/lib/modules/*/build`
86− sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \
87− -e 's@MKISOFS --version@MKISOFS -version@' \
62+ sed -e 's@MKISOFS --version@MKISOFS -version@' \
8863 -e 's@PYTHONDIR=.*@PYTHONDIR=${if pythonBindings then python else ""}@' \
89− -i configure
64+ ${optionalString (!headless) ''
65+ -e 's@TOOLQT5BIN=.*@TOOLQT5BIN="${getDev qt5.qtbase}/bin"@' \
66+ ''} -i configure
9067 ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2
9168 ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2
92− find . -type f -iname '*makefile*' -exec sed -i -e 's/depmod -a/:/g' {} +
9369 sed -i -e '
9470 s@"libdbus-1\.so\.3"@"${dbus.lib}/lib/libdbus-1.so.3"@g
9571 s@"libasound\.so\.2"@"${alsaLib.out}/lib/libasound.so.2"@g
@@ -103,11 +79,12 @@ in stdenv.mkDerivation {
10379 set +x
10480 '';
10581
106− patches = optional enableHardening ./hardened.patch;
82+ patches = optional enableHardening ./hardened.patch
83+ ++ [ ./libressl.patch ./qtx11extras.patch ];
10784
10885 postPatch = ''
10986 sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|' \
110− src/apps/adpctl/VBoxNetAdpCtl.cpp
87+ src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp
11188 '';
11289
11390 # first line: ugly hack, and it isn't yet clear why it's a problem
@@ -131,11 +108,15 @@ in stdenv.mkDerivation {
131108 ${optionalString javaBindings ''
132109 VBOX_JAVA_HOME := ${jdk}
133110 ''}
111+ ${optionalString (!headless) ''
112+ PATH_QT5_X11_EXTRAS_LIB := ${getLib qt5.qtx11extras}/lib
113+ PATH_QT5_X11_EXTRAS_INC := ${getDev qt5.qtx11extras}/include
114+ TOOL_QT5_LRC := ${getDev qt5.qttools}/bin/lrelease
115+ ''}
134116 LOCAL_CONFIG
135117
136118 ./configure \
137119 ${optionalString headless "--build-headless"} \
138− ${optionalString (!headless) "--with-qt4-dir=${qt4}"} \
139120 ${optionalString (!javaBindings) "--disable-java"} \
140121 ${optionalString (!pythonBindings) "--disable-python"} \
141122 ${optionalString (!pulseSupport) "--disable-pulse"} \
@@ -153,7 +134,6 @@ in stdenv.mkDerivation {
153134 buildPhase = ''
154135 source env.sh
155136 kmk -j $NIX_BUILD_CORES BUILD_TYPE="${buildType}"
156− ${forEachModule "modules"}
157137 '';
158138
159139 installPhase = ''
@@ -165,9 +145,6 @@ in stdenv.mkDerivation {
165145 find out/linux.*/${buildType}/bin -mindepth 1 -maxdepth 1 \
166146 -name src -o -exec cp -avt "$libexec" {} +
167147
168− # Install kernel modules
169− ${forEachModule "modules_install"}
170−
171148 # Create wrapper script
172149 mkdir -p $out/bin
173150 for file in VirtualBox VBoxManage VBoxSDL VBoxBalloonCtrl VBoxBFE VBoxHeadless; do
@@ -199,8 +176,7 @@ in stdenv.mkDerivation {
199176 done
200177 ''}
201178
202− # Get rid of a reference to linux.dev.
203− nuke-refs $out/lib/modules/*/misc/*.ko
179+ cp -rv out/linux.*/${buildType}/bin/src "$modsrc"
204180 '';
205181
206182 passthru = { inherit version; /* for guest additions */ };
pkgs/applications/virtualization/virtualbox/guest-additions/default.nix+1−1
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
1212
1313 src = fetchurl {
1414 url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
15− sha256 = "7458ee5a7121a7d243fd6a7528ba427945d9120c5efc7cd75b3951fb01f09c59";
15+ sha256 = (lib.importJSON ../upstream-info.json).guest;
1616 };
1717
1818 KERN_DIR = "${kernel.dev}/lib/modules/*/build";
pkgs/applications/virtualization/virtualbox/libressl.patchnew file+47
@@ -0,0 +1,47 @@
1+diff --git a/src/VBox/Runtime/common/crypto/digest-builtin.cpp b/src/VBox/Runtime/common/crypto/digest-builtin.cpp
2+index 66b4304..1aaceff 100644
3+--- a/src/VBox/Runtime/common/crypto/digest-builtin.cpp
4++++ b/src/VBox/Runtime/common/crypto/digest-builtin.cpp
5+@@ -561,7 +561,7 @@ static PCRTCRDIGESTDESC const g_apDigestOps[] =
6+ * OpenSSL EVP.
7+ */
8+
9+-# if OPENSSL_VERSION_NUMBER >= 0x10100000
10++# if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
11+ /** @impl_interface_method{RTCRDIGESTDESC::pfnNew} */
12+ static DECLCALLBACK(void*) rtCrDigestOsslEvp_New(void)
13+ {
14+@@ -597,7 +597,7 @@ static DECLCALLBACK(int) rtCrDigestOsslEvp_Init(void *pvState, void *pvOpaque, b
15+ if (fReInit)
16+ {
17+ pEvpType = EVP_MD_CTX_md(pThis);
18+-# if OPENSSL_VERSION_NUMBER >= 0x10100000
19++# if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
20+ EVP_MD_CTX_reset(pThis);
21+ # else
22+ EVP_MD_CTX_cleanup(pThis);
23+@@ -616,7 +616,7 @@ static DECLCALLBACK(int) rtCrDigestOsslEvp_Init(void *pvState, void *pvOpaque, b
24+ static DECLCALLBACK(void) rtCrDigestOsslEvp_Delete(void *pvState)
25+ {
26+ EVP_MD_CTX *pThis = (EVP_MD_CTX *)pvState;
27+-# if OPENSSL_VERSION_NUMBER >= 0x10100000
28++# if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
29+ EVP_MD_CTX_reset(pThis);
30+ # else
31+ EVP_MD_CTX_cleanup(pThis);
32+@@ -661,13 +661,13 @@ static RTCRDIGESTDESC const g_rtCrDigestOpenSslDesc =
33+ NULL,
34+ RTDIGESTTYPE_UNKNOWN,
35+ EVP_MAX_MD_SIZE,
36+-# if OPENSSL_VERSION_NUMBER >= 0x10100000
37++# if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
38+ 0,
39+ # else
40+ sizeof(EVP_MD_CTX),
41+ # endif
42+ 0,
43+-# if OPENSSL_VERSION_NUMBER >= 0x10100000
44++# if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
45+ rtCrDigestOsslEvp_New,
46+ rtCrDigestOsslEvp_Free,
47+ # else
pkgs/applications/virtualization/virtualbox/qtx11extras.patchnew file+31
@@ -0,0 +1,31 @@
1+diff --git a/kBuild/units/qt5.kmk b/kBuild/units/qt5.kmk
2+index 71b96a3..73391f0 100644
3+--- a/kBuild/units/qt5.kmk
4++++ b/kBuild/units/qt5.kmk
5+@@ -994,9 +994,10 @@ else
6+ $(eval $(target)_LIBS += $(PATH_SDK_QT5_LIB)/$(qt_prefix)qtmain$(qt_infix)$(SUFF_LIB) )
7+ endif
8+ else
9+- $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT5_LIB)/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) )
10++ $(eval $(target)_LIBS += $(foreach module,$(qt_modules), $(PATH_SDK_QT5_LIB)/lib$(qt_prefix)Qt5$(module)$(qt_infix)$(SUFF_DLL)) \
11++ $(PATH_QT5_X11_EXTRAS_LIB)/lib$(qt_prefix)Qt5X11Extras$(qt_infix)$(SUFF_DLL))
12+ endif
13+- $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) )
14++ $(eval $(target)_INCS += $(addprefix $(PATH_SDK_QT5_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT5_INC) $(PATH_QT5_X11_EXTRAS_INC)/QtX11Extras )
15+ endif
16+ $(eval $(target)_DEFS += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) )
17+
18+diff --git a/src/VBox/Frontends/VirtualBox/Makefile.kmk b/src/VBox/Frontends/VirtualBox/Makefile.kmk
19+index 38db6b0..7dd446b 100644
20+--- a/src/VBox/Frontends/VirtualBox/Makefile.kmk
21++++ b/src/VBox/Frontends/VirtualBox/Makefile.kmk
22+@@ -912,9 +912,6 @@ VirtualBox_QT_MODULES = Core Gui
23+ ifdef VBOX_WITH_QTGUI_V5
24+ # Qt5 requires additional modules:
25+ VirtualBox_QT_MODULES += Widgets PrintSupport
26+- VirtualBox_QT_MODULES.linux += X11Extras
27+- VirtualBox_QT_MODULES.solaris += X11Extras
28+- VirtualBox_QT_MODULES.freebsd += X11Extras
29+ VirtualBox_QT_MODULES.darwin += MacExtras
30+ VirtualBox_QT_MODULES.win += WinExtras
31+ endif # VBOX_WITH_QTGUI_V5
pkgs/applications/virtualization/virtualbox/update.pynew file+83
@@ -0,0 +1,83 @@
1+#!/usr/bin/env python3
2+import os
3+import re
4+import json
5+import urllib.request
6+
7+from distutils.version import LooseVersion
8+
9+UPSTREAM_INFO_FILE = os.path.join(
10+ os.path.dirname(os.path.abspath(__file__)),
11+ "upstream-info.json"
12+)
13+
14+
15+def fetch_latest_version():
16+ url = "http://download.virtualbox.org/virtualbox/LATEST.TXT"
17+ return urllib.request.urlopen(url).read().strip().decode()
18+
19+
20+def load_upstream_info():
21+ try:
22+ with open(UPSTREAM_INFO_FILE, 'r') as fp:
23+ return json.load(fp)
24+ except FileNotFoundError:
25+ return {'version': "0"}
26+
27+
28+def save_upstream_info(contents):
29+ remark = "Generated using update.py from the same directory."
30+ contents['__NOTE'] = remark
31+ data = json.dumps(contents, indent=2, sort_keys=True)
32+ with open(UPSTREAM_INFO_FILE, 'w') as fp:
33+ fp.write(data + "\n")
34+
35+
36+def fetch_file_table(version):
37+ url = "http://download.virtualbox.org/virtualbox/{}/SHA256SUMS"
38+ url = url.format(version)
39+ result = {}
40+ for line in urllib.request.urlopen(url):
41+ sha, name = line.rstrip().split()
42+ result[name.lstrip(b'*').decode()] = sha.decode()
43+ return result
44+
45+
46+def update_to_version(version):
47+ extpack_start = 'Oracle_VM_VirtualBox_Extension_Pack-'
48+ version_re = version.replace('.', '\\.')
49+ attribute_map = {
50+ 'extpack': r'^' + extpack_start + r'[^-]+-[^.]+.vbox-extpack$',
51+ 'extpackRev': r'^' + extpack_start + r'[^-]+-([^.]+).vbox-extpack$',
52+ 'main': r'^VirtualBox-' + version_re + r'.tar.bz2$',
53+ 'guest': r'^VBoxGuestAdditions_' + version_re + r'.iso$',
54+ }
55+ table = fetch_file_table(version)
56+ new_attrs = {'version': version}
57+ for attr, searchexpr in attribute_map.items():
58+ result = [re.search(searchexpr, key) for key in table.keys()]
59+ filtered = filter(lambda m: m is not None, result)
60+ found = [m.groups()[0] if len(m.groups()) > 0 else table[m.group(0)]
61+ for m in filtered if m is not None]
62+
63+ if len(found) == 0:
64+ msg = "No package found for attribute {}".format(attr)
65+ raise AssertionError(msg)
66+ elif len(found) != 1:
67+ msg = "More than one package found for attribute {}: ".format(attr)
68+ msg += ', '.join(found)
69+ raise AssertionError(msg)
70+ else:
71+ new_attrs[attr] = found[0]
72+ return new_attrs
73+
74+
75+info = load_upstream_info()
76+latest = fetch_latest_version()
77+if LooseVersion(info['version']) < LooseVersion(latest):
78+ print("Updating to version {}...".format(latest), end="", flush=True)
79+ new_attrs = update_to_version(latest)
80+ save_upstream_info(new_attrs)
81+ print(" done.")
82+else:
83+ print("Version {} is already the latest one.".format(info['version']))
pkgs/applications/virtualization/virtualbox/upstream-info.jsonnew file+8
@@ -0,0 +1,8 @@
1+{
2+ "__NOTE": "Generated using update.py from the same directory.",
3+ "extpack": "607ac3636bd49a738d5c48159b39261369b5487f71fb10afa2ecf869627a12de",
4+ "extpackRev": "110634",
5+ "guest": "cbcf9b9b1000e09911b3d20e1efe529aef8a945cf130f6abffc14a39522cc1ed",
6+ "main": "2e0112b0d85841587b8f212e6ba8f6c35b31e1cce6b6999497dc917cd37e6911",
7+ "version": "5.1.6"
8+}
pkgs/os-specific/linux/virtualbox/default.nixnew file+23
@@ -0,0 +1,23 @@
1+{ stdenv, virtualbox, kernel, strace }:
2+
3+stdenv.mkDerivation {
4+ name = "virtualbox-modules-${virtualbox.version}-${kernel.version}";
5+ src = virtualbox.modsrc;
6+ hardeningDisable = [
7+ "fortify" "pic" "stackprotector"
8+ ];
9+
10+ makeFlags = [
11+ "-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
12+ "INSTALL_MOD_PATH=$(out)"
13+ ];
14+ preBuild = "makeFlagsArray+=(\"M=$(pwd)\")";
15+ buildFlags = [ "modules" ];
16+ installTargets = [ "modules_install" ];
17+
18+ enableParallelBuilding = true;
19+
20+ meta = virtualbox.meta // {
21+ description = virtualbox.meta.description + " (kernel modules)";
22+ };
23+}
pkgs/top-level/all-packages.nix+21−15
@@ -11400,23 +11400,13 @@ in
1140011400
1140111401 vhba = callPackage ../misc/emulators/cdemu/vhba.nix { };
1140211402
11403− virtualbox = callPackage ../applications/virtualization/virtualbox {
11404− stdenv = stdenv_32bit;
11405− inherit (gnome2) libIDL;
11406− enableExtensionPack = config.virtualbox.enableExtensionPack or false;
11407− pulseSupport = config.pulseaudio or false;
11403+ virtualbox = callPackage ../os-specific/linux/virtualbox {
11404+ virtualbox = pkgs.virtualboxHardened;
1140811405 };
1140911406
11410− virtualboxHardened = lowPrio (virtualbox.override {
11411− enableHardening = true;
11412− });
11413−
11414− virtualboxHeadless = lowPrio (virtualbox.override {
11415− enableHardening = true;
11416− headless = true;
11417− });
11418−
11419− virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions { };
11407+ virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions {
11408+ virtualbox = pkgs.virtualboxHardened;
11409+ };
1142011410
1142111411 wireguard = callPackage ../os-specific/linux/wireguard { };
1142211412
@@ -15232,6 +15222,22 @@ in
1523215222
1523315223 virtinst = callPackage ../applications/virtualization/virtinst {};
1523415224
15225+ virtualbox = callPackage ../applications/virtualization/virtualbox {
15226+ stdenv = stdenv_32bit;
15227+ inherit (gnome2) libIDL;
15228+ enableExtensionPack = config.virtualbox.enableExtensionPack or false;
15229+ pulseSupport = config.pulseaudio or true;
15230+ };
15231+
15232+ virtualboxHardened = lowPrio (virtualbox.override {
15233+ enableHardening = true;
15234+ });
15235+
15236+ virtualboxHeadless = lowPrio (virtualbox.override {
15237+ enableHardening = true;
15238+ headless = true;
15239+ });
15240+
1523515241 virtualglLib = callPackage ../tools/X11/virtualgl/lib.nix {
1523615242 fltk = fltk13;
1523715243 };