1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

nixos/virtualisation.virtualbox.guest: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-28 21:19:12 +02:00 committed by Jörg Thalheim
parent 3cd35f7830
commit 49fe5ca12c

View file

@ -1,9 +1,5 @@
# Module for VirtualBox guests.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.virtualisation.virtualbox.guest;
kernel = config.boot.kernelPackages;
@ -32,38 +28,38 @@ let
in
{
imports = [
(mkRenamedOptionModule [ "virtualisation" "virtualbox" "guest" "draganddrop" ] [ "virtualisation" "virtualbox" "guest" "dragAndDrop" ])
(lib.mkRenamedOptionModule [ "virtualisation" "virtualbox" "guest" "draganddrop" ] [ "virtualisation" "virtualbox" "guest" "dragAndDrop" ])
];
options.virtualisation.virtualbox.guest = {
enable = mkOption {
enable = lib.mkOption {
default = false;
type = types.bool;
type = lib.types.bool;
description = "Whether to enable the VirtualBox service and other guest additions.";
};
clipboard = mkOption {
clipboard = lib.mkOption {
default = true;
type = types.bool;
type = lib.types.bool;
description = "Whether to enable clipboard support.";
};
seamless = mkOption {
seamless = lib.mkOption {
default = true;
type = types.bool;
type = lib.types.bool;
description = "Whether to enable seamless mode. When activated windows from the guest appear next to the windows of the host.";
};
dragAndDrop = mkOption {
dragAndDrop = lib.mkOption {
default = true;
type = types.bool;
type = lib.types.bool;
description = "Whether to enable drag and drop support.";
};
};
###### implementation
config = mkIf cfg.enable (mkMerge [
config = lib.mkIf cfg.enable (lib.mkMerge [
{
assertions = [{
assertion = pkgs.stdenv.hostPlatform.isx86;
@ -104,17 +100,17 @@ in
systemd.user.services.virtualboxClientVmsvga = mkVirtualBoxUserService "--vmsvga-session";
}
(
mkIf cfg.clipboard {
lib.mkIf cfg.clipboard {
systemd.user.services.virtualboxClientClipboard = mkVirtualBoxUserService "--clipboard";
}
)
(
mkIf cfg.seamless {
lib.mkIf cfg.seamless {
systemd.user.services.virtualboxClientSeamless = mkVirtualBoxUserService "--seamless";
}
)
(
mkIf cfg.dragAndDrop {
lib.mkIf cfg.dragAndDrop {
systemd.user.services.virtualboxClientDragAndDrop = mkVirtualBoxUserService "--draganddrop";
}
)