anchor.diff:        '';
   
       # Since we lack the right setuid binaries, set up a host-only network by default.
  -  } (mkIf config.services.virtualboxHost.addNetworkInterface {
  +  } (mkIf cfg.addNetworkInterface {
       systemd.services."vboxnet0" =
         { description = "VirtualBox vboxnet0 Interface";
           requires = [ "dev-vboxnetctl.device" ];
  
positive.code:         group = "vboxusers";
          setuid = true;
        };
      in map mkVboxStub [
        "VBoxHeadless"
        "VBoxSDL"
        "VirtualBox"
      ];
  
      users.extraGroups.vboxusers.gid = config.ids.gids.vboxusers;
  
  
negative.code: with lib;
  
  let
    cfg = config.services.virtualboxHost;
    virtualbox = config.boot.kernelPackages.virtualbox.override {
      inherit (cfg) enableHardening;
    };
  
  in
  
  {
    options.services.virtualboxHost = {
      enable = mkEnableOption "VirtualBox Host support";
  
      addNetworkInterface = mkOption {
        type = types.bool;
        default = true;
        description = ''
          Automatically set up a vboxnet0 host-only network interface.
        '';
      };
  
      enableHardening = mkOption {
        type = types.bool;
        default = true;
        description = ''
          Enable hardened VirtualBox, which ensures that only the binaries in the
          system path get access to the devices exposed by the kernel modules
          instead of all users in the vboxusers group.
  
          <important><para>
            Disabling this can put your system's security at risk, as local users
            in the vboxusers group can tamper with the VirtualBox device files.
          </para></important>
        '';
      };
    };
  
    config = mkIf cfg.enable (mkMerge [{
      boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ];
      boot.extraModulePackages = [ virtualbox ];
      environment.systemPackages = [ virtualbox ];
  