Virtual Keyboard at SDDM not working

SDDM has a link (button, if you wish) for a virtual keyboard before you sign in. This would be useful for either someone who had accessibly issues or your Bluetooth keyboard failed to connect, before signing. However, it is not working, and I am puzzled as to why.

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables SDDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

       services.desktopManager.plasma6.enable = true;  # Enables the KDE Plasma desktop environment.
       services.displayManager.sddm.enable = true;     # Required for graphical login.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

services.displayManager.sddm.settings = {
  General = {
    InputMethod = "qtvirtualkeyboard";  # Enables optional virtual keyboard at login (SDDM). Useful for touchscreens or accessibility.
  };
};

environment.variables = {
  QT_IM_MODULE = "qtvirtualkeyboard";  # Required to ensure full QT Support with virtual keyboard.
};



#  🖥️ X11 vs Wayland.
#  At the SDDM login screen, you can choose either "Plasma (X11)" or "Plasma (Wayland)".
#  Click the gear icon before logging in to pick your session.
#
#  ✅ Tip: If you're unsure, try Wayland — you can switch back at any time.

#  🪟 Enable Wayland (modern graphical system).
          services.displayManager.sddm.wayland.enable = true;

#  🖼️ Enable X11 (legacy graphical system).
#  KDE Plasma supports both. You can leave both enabled if you're not sure which to use.
       services.xserver.enable = true;

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.

Well, after a while, I sometimes noticed apps would freeze up, and I needed to click on the taskbar to regain control. So I went to a simpler method and picked onboard, which wouldn’t need me to extend out QT support. – But, however, sadly, SDDM still does not have a working virtual keyboard at SDDM.

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables SDDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

       services.desktopManager.plasma6.enable = true;  # Enables the KDE Plasma desktop environment.
       services.displayManager.sddm.enable = true;     # Required for graphical login.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

services.displayManager.sddm.setupScript = ''
  ${pkgs.onboard}/bin/onboard &
'';

#  🖥️ X11 vs Wayland.
#  At the SDDM login screen, you can choose either "Plasma (X11)" or "Plasma (Wayland)".
#  Click the gear icon before logging in to pick your session.
#
#  ✅ Tip: If you're unsure, try Wayland — you can switch back at any time.

#  🪟 Enable Wayland (modern graphical system).
          services.displayManager.sddm.wayland.enable = true;

#  🖼️ Enable X11 (legacy graphical system).
#  KDE Plasma supports both. You can leave both enabled if you're not sure which to use.
       services.xserver.enable = true;

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.

Generally speaking, this should work, it isn’t complicated and cleans up nicely, but no luck.

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables SDDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

       services.desktopManager.plasma6.enable = true;  # Enables the KDE Plasma desktop environment.
       services.displayManager.sddm.enable = true;     # Required for graphical login.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

services.displayManager.sddm.settings = {
  General = {
    InputMethod = "qtvirtualkeyboard";
  };
};

services.displayManager.sddm.extraPackages = [ pkgs.kdePackages.qtvirtualkeyboard ];

#  🖥️ X11 vs Wayland.
#  At the SDDM login screen, you can choose either "Plasma (X11)" or "Plasma (Wayland)".
#  Click the gear icon before logging in to pick your session.
#
#  ✅ Tip: If you're unsure, try Wayland — you can switch back at any time.

#  🪟 Enable Wayland (modern graphical system).
          services.displayManager.sddm.wayland.enable = true;

#  🖼️ Enable X11 (legacy graphical system).
#  KDE Plasma supports both. You can leave both enabled if you're not sure which to use.
       services.xserver.enable = true;

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.

It looks like you’re using wayland, you might need to try maliit-keyboard

1 Like

Well, this one did not work either. :rofl:

I am going to try @crazymevt suggestion next and am just documenting what I have tried.

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables SDDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

       services.desktopManager.plasma6.enable = true;  # Enables the KDE Plasma desktop environment.
       services.displayManager.sddm.enable = true;     # Required for graphical login.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

services.displayManager.sddm.settings = {
  General = {
    InputMethod = "qtvirtualkeyboard";
  };
};

 # This is important: use a theme that supports the virtual keyboard
  services.displayManager.sddm.theme = "breeze";  # Or another theme that shows the "keyboard" icon

services.displayManager.sddm.extraPackages = with pkgs.kdePackages; [
  qtvirtualkeyboard
  sddm-kcm  # Optional: KDE SDDM Config Module
  breeze
];


#  🖥️ X11 vs Wayland.
#  At the SDDM login screen, you can choose either "Plasma (X11)" or "Plasma (Wayland)".
#  Click the gear icon before logging in to pick your session.
#
#  ✅ Tip: If you're unsure, try Wayland — you can switch back at any time.

#  🪟 Enable Wayland (modern graphical system).
          services.displayManager.sddm.wayland.enable = true;

#  🖼️ Enable X11 (legacy graphical system).
#  KDE Plasma supports both. You can leave both enabled if you're not sure which to use.
       services.xserver.enable = true;

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.

I tried maliit-keyboard as suggested by @crazymevt I tried with just specifying the impute method, then expanded to ensure the setup script would load, and when that failed, even tried adding a delay, because I worried perhaps I was racing somewhere (nothing in the logs suggest this, but I thought it wouldn’t hurt).

Still no luck.

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables SDDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

       services.desktopManager.plasma6.enable = true;  # Enables the KDE Plasma desktop environment.
       services.displayManager.sddm.enable = true;     # Required for graphical login.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

services.displayManager.sddm.setupScript = ''
  sleep 2
  ${pkgs.maliit-keyboard}/bin/maliit-keyboard &
'';

services.displayManager.sddm.settings = {
  General = {
    InputMethod = "maliit-keyboard";
  };
};

 # This is important: use a theme that supports the virtual keyboard
  services.displayManager.sddm.theme = "breeze";  # Or another theme that shows the "keyboard" icon

services.displayManager.sddm.extraPackages = with pkgs.kdePackages; [
  pkgs.maliit-keyboard
  pkgs.maliit-framework
  sddm-kcm  # Optional: KDE SDDM Config Module
  breeze
];


#  🖥️ X11 vs Wayland.
#  At the SDDM login screen, you can choose either "Plasma (X11)" or "Plasma (Wayland)".
#  Click the gear icon before logging in to pick your session.
#
#  ✅ Tip: If you're unsure, try Wayland — you can switch back at any time.

#  🪟 Enable Wayland (modern graphical system).
          services.displayManager.sddm.wayland.enable = true;

#  🖼️ Enable X11 (legacy graphical system).
#  KDE Plasma supports both. You can leave both enabled if you're not sure which to use.
       services.xserver.enable = true;

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.

SOLUTION:

Ditch SDDM and replace it with GDM. – It is not what I was looking for, but it works.

:warning: Caution: When you perform sudo nixos-rebuild switch

Or, as I commonly used: sudo nixos-rebuild switch --upgrade

You will be automatically logged out and see the GDM. You can log right back in and may receive a “no impute” display. Wait awhile, make sure that build finishes (because I’m unsure if it happens in the middle of the build or the build finished), then physically reboot your computer.

Someone using KDE Plasma will have to test and pay closer attention then I did (I walked out of the room for a bit). That said – It works! I’ll take it. :rofl:

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables GDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

     services.desktopManager.plasma6.enable = true;        # Enables the KDE Plasma desktop environment.
     services.displayManager.sddm.enable = false;          # Required Disable SDDM - Disabled because it does not work with a Virtual Keyboard.
     services.xserver.displayManager.gdm.enable = true;    # Required for graphical login. - GDM (Grnome Display Manager) works with VM Keyboard and can be used with KDE.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

# Start Maliit virtual keyboard after graphical.target is reached.
systemd.services.maliit-keyboard = {
  description = "Launch Maliit virtual keyboard.";
  wantedBy = [ "graphical.target" ];  # Start after graphical.target (post-login screen).
  serviceConfig.ExecStart = "${pkgs.maliit-keyboard}/bin/maliit-keyboard";  # Start Maliit keyboard.
  serviceConfig.Restart = "always";   # Ensure it restarts if it crashes.
};


#  🖥️ X11 vs Wayland.
#  At the GDM login screen, you can choose either "Plasma (X11)" or "Plasma (Wayland)".
#  Click the gear icon before logging in to pick your session.
#
#  ✅ Tip: If you're unsure, try Wayland — you can switch back at any time.

#  🪟 Enable Wayland (modern graphical system).
       services.xserver.displayManager.gdm.wayland = true;

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.

Small change to enable xWayland support. This prevents maliit-keyboard from crashing.

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables GDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

     services.desktopManager.plasma6.enable = true;        # Enables the KDE Plasma desktop environment.
     services.xserver.displayManager.gdm.wayland = true;   # Enable Wayland (modern graphical system).
     programs.xwayland.enable = true;                      # xWayland support for x11 apps
     services.displayManager.sddm.enable = false;          # Required Disable SDDM - Disabled because it does not work with a Virtual Keyboard.
     services.xserver.displayManager.gdm.enable = true;    # Required for graphical login. - GDM (Grnome Display Manager) works with VM Keyboard and can be used with KDE.

#  ⌨️ This configuration enables the virtual keyboard.
#  In addition to supporting accessibility needs, it can also be helpful if your Bluetooth keyboard fails to connect before logging in.

# Start Maliit virtual keyboard after graphical.target is reached.
systemd.services.maliit-keyboard = {
  description = "Launch Maliit virtual keyboard.";
  wantedBy = [ "graphical.target" ];  # Start after graphical.target (post-login screen).
  serviceConfig.ExecStart = "${pkgs.maliit-keyboard}/bin/maliit-keyboard";  # Start Maliit keyboard.
  serviceConfig.Restart = "always";   # Ensure it restarts if it crashes.
};


#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.```

Final SOLUTION:

Someone messages me and told me I don’t need to specify the virtual keyboard with GDM. I’m not a Gnome user, which means I don’t typically use GDM, so that was news to me. It also saved me trouble because I was trying to debug how to keep the keyboard loaded using systemd.

This is the final working config. – I am making this as the solution. No error and it works!

#  ----------------------------------------
#  🖼️ Graphical Desktop.
#  ----------------------------------------

#  🖼️ Enable KDE Plasma (Graphical Desktop).
#  This enables the KDE Plasma desktop — a modern, user-friendly graphical interface.
#  It also enables GDM (the login screen), which is required for graphical logins.
#  Without it, you won't see a login screen or access KDE.

     services.desktopManager.plasma6.enable = true;        # Enables the KDE Plasma desktop environment.
     services.xserver.displayManager.gdm.wayland = true;   # Enable Wayland (modern graphical system).
     programs.xwayland.enable = true;                      # xWayland support for x11 apps
     services.displayManager.sddm.enable = false;          # Required Disable SDDM - Disabled because it does not work with a Virtual Keyboard.
     services.xserver.displayManager.gdm.enable = true;    # Required for graphical login. - GDM (Grnome Display Manager) works with VM Keyboard and can be used with KDE.

#  🧑‍💻 Keyboard Layout (X11 only).
#  Sets the keyboard layout for X11. Wayland layouts are handled through KDE settings.
#  Change the layout code below if you're using something other than US QWERTY.
       services.xserver.xkb = {
       layout = "us";     # ⬅️ Change this to your layout (e.g., "de", "fr", "uk").
       variant = "";      # Optional: Variant for more specific layouts.
     };

#  ----------------------------------------
#  🖱️ Touchpad & Input Device Support.
#  ----------------------------------------
#  This enables the libinput driver for touchpads and other input devices.
#  KDE handles most input automatically under Wayland, but enabling this ensures
#  proper support across both X11 and Wayland — especially for touchpads and touchscreens.
       services.libinput.enable = true;  # Recommended for reliable input device support.