Commit 1ae175fe authored by Felix Singer's avatar Felix Singer
Browse files

nixos/virtualbox-guest: Allow using in-tree kernel modules



Since commit 78c1d0ba ("linux: Enable Virtualbox guest modules") the
NixOS kernel ships the in-tree kernel modules for Virtualbox guests.
Since they do work well with the Virtualbox guest utils, add a switch to
the related NixOS module allowing users to not use the 3rd party kernel
modules. Enable the 3rd party modules by default in order to not change
the current behavior.

Signed-off-by: default avatarFelix Singer <felixsinger@posteo.net>
parent ee2162fc
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -95,6 +95,12 @@ in
      type = lib.types.bool;
      description = "Whether to load vboxsf";
    };

    use3rdPartyModules = lib.mkOption {
      default = true;
      type = lib.types.bool;
      description = "Whether to use the kernel modules provided by VirtualBox instead of the ones from the upstream kernel.";
    };
  };

  ###### implementation
@@ -111,7 +117,7 @@ in

        environment.systemPackages = [ kernel.virtualboxGuestAdditions ];

        boot.extraModulePackages = [ kernel.virtualboxGuestAdditions ];
        boot.extraModulePackages = lib.mkIf cfg.use3rdPartyModules [ kernel.virtualboxGuestAdditions ];

        systemd.services.virtualbox = {
          description = "VirtualBox Guest Services";