I run NixOS 22.05 with the stable channel in VMWare Fusion 11.5.3, both x86-64.
I’m able to make Sway work using this configuration:
{ config, pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
virtualisation.vmware.guest.enable = true;
networking.useDHCP = false;
networking.interfaces.ens33.useDHCP = true;
programs.sway.enable = true;
environment.loginShellInit = ''
if [ "$(tty)" == /dev/tty1 ]; then
export WLR_NO_HARDWARE_CURSORS=1
sway
fi
'';
users.mutableUsers = false;
users.users.name = {
isNormalUser = true;
extraGroups = [ "wheel" ];
hashedPassword = "<password>";
};
system.stateVersion = "22.05";
}
However, it has a two drawbacks:
- Upon booting, I’m presented with a terminal, and only when I log in as the user, Sway is started.
- When I resize the VM window, Sway doesn’t change resolution. The image is simply stretched. (The mouse however can travel seamlessly between the VM window and the host desktop. It seems the guest add-on is successfully loaded.)
I tried to solve #1 by installing a display manager:
services.xserver = {
enable = true;
videoDrivers = [ "vmware" ];
displayManager.gdm.enable = true;
displayManager.autoLogin.enable = true;
displayManager.autoLogin.user = "name";
};
But upon booting, I’m presented with a black screen. I presume it’s because gdm brought up sway without setting the WLR_NO_HARDWARE_CURSORS
env, and I’m not sure if I should even install gdm to begin with, since I only want to use Wayland and not X.
Does anyone have any ideas on how to solve the two issues? Thanks in advance.