Loading nixos/modules/virtualisation/vmware-guest.nix +8 −11 Original line number Diff line number Diff line { config, lib, pkgs, ... }: with lib; let cfg = config.virtualisation.vmware.guest; open-vm-tools = if cfg.headless then pkgs.open-vm-tools-headless else pkgs.open-vm-tools; Loading @@ -9,20 +6,20 @@ let in { imports = [ (mkRenamedOptionModule [ "services" "vmwareGuest" ] [ "virtualisation" "vmware" "guest" ]) (lib.mkRenamedOptionModule [ "services" "vmwareGuest" ] [ "virtualisation" "vmware" "guest" ]) ]; options.virtualisation.vmware.guest = { enable = mkEnableOption "VMWare Guest Support"; headless = mkOption { type = types.bool; enable = lib.mkEnableOption "VMWare Guest Support"; headless = lib.mkOption { type = lib.types.bool; default = !config.services.xserver.enable; defaultText = "!config.services.xserver.enable"; description = "Whether to disable X11-related features."; }; }; config = mkIf cfg.enable { config = lib.mkIf cfg.enable { assertions = [ { assertion = pkgs.stdenv.hostPlatform.isx86 || pkgs.stdenv.hostPlatform.isAarch64; message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}"; Loading @@ -42,7 +39,7 @@ in }; # Mount the vmblock for drag-and-drop and copy-and-paste. systemd.mounts = mkIf (!cfg.headless) [ systemd.mounts = lib.mkIf (!cfg.headless) [ { description = "VMware vmblock fuse mount"; documentation = [ "https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt" ]; Loading @@ -55,7 +52,7 @@ in } ]; security.wrappers.vmware-user-suid-wrapper = mkIf (!cfg.headless) { security.wrappers.vmware-user-suid-wrapper = lib.mkIf (!cfg.headless) { setuid = true; owner = "root"; group = "root"; Loading @@ -64,7 +61,7 @@ in environment.etc.vmware-tools.source = "${open-vm-tools}/etc/vmware-tools/*"; services.xserver = mkIf (!cfg.headless) { services.xserver = lib.mkIf (!cfg.headless) { modules = lib.optionals pkgs.stdenv.hostPlatform.isx86 [ xf86inputvmmouse ]; config = lib.optionalString (pkgs.stdenv.hostPlatform.isx86) '' Loading Loading
nixos/modules/virtualisation/vmware-guest.nix +8 −11 Original line number Diff line number Diff line { config, lib, pkgs, ... }: with lib; let cfg = config.virtualisation.vmware.guest; open-vm-tools = if cfg.headless then pkgs.open-vm-tools-headless else pkgs.open-vm-tools; Loading @@ -9,20 +6,20 @@ let in { imports = [ (mkRenamedOptionModule [ "services" "vmwareGuest" ] [ "virtualisation" "vmware" "guest" ]) (lib.mkRenamedOptionModule [ "services" "vmwareGuest" ] [ "virtualisation" "vmware" "guest" ]) ]; options.virtualisation.vmware.guest = { enable = mkEnableOption "VMWare Guest Support"; headless = mkOption { type = types.bool; enable = lib.mkEnableOption "VMWare Guest Support"; headless = lib.mkOption { type = lib.types.bool; default = !config.services.xserver.enable; defaultText = "!config.services.xserver.enable"; description = "Whether to disable X11-related features."; }; }; config = mkIf cfg.enable { config = lib.mkIf cfg.enable { assertions = [ { assertion = pkgs.stdenv.hostPlatform.isx86 || pkgs.stdenv.hostPlatform.isAarch64; message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}"; Loading @@ -42,7 +39,7 @@ in }; # Mount the vmblock for drag-and-drop and copy-and-paste. systemd.mounts = mkIf (!cfg.headless) [ systemd.mounts = lib.mkIf (!cfg.headless) [ { description = "VMware vmblock fuse mount"; documentation = [ "https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt" ]; Loading @@ -55,7 +52,7 @@ in } ]; security.wrappers.vmware-user-suid-wrapper = mkIf (!cfg.headless) { security.wrappers.vmware-user-suid-wrapper = lib.mkIf (!cfg.headless) { setuid = true; owner = "root"; group = "root"; Loading @@ -64,7 +61,7 @@ in environment.etc.vmware-tools.source = "${open-vm-tools}/etc/vmware-tools/*"; services.xserver = mkIf (!cfg.headless) { services.xserver = lib.mkIf (!cfg.headless) { modules = lib.optionals pkgs.stdenv.hostPlatform.isx86 [ xf86inputvmmouse ]; config = lib.optionalString (pkgs.stdenv.hostPlatform.isx86) '' Loading