Enable Plasma 6

Is there a basic working plasma 6 config I can use as a starting place? I’ve tried doing a fresh NixOS 24.05 Plasma6 installation, but failed: Plasma6 sddm login hangs

I got it booting & managed to login, but the panel is empty, I get crash log windows on most stuff I try to start and the system is utterly useless.

I was hoping to get something close to the installer iso which is working fine on my machine, but allas this doesn’t seem to be as easy as hoped.

I had a basic working NixOS 24.05 system running with the default Gnome desktop, but was keen to try KDE Plasma and Wayland. Sadly the result was just a tty-only login with no windowing system.

I tried to follow the steps above, however as I had not been running KDE5 beforehand some of them did not seem to be relevant.

So anyhow I-

  • switched to the nixos-unstable channel
  • did a nix-channel --update
  • Made the following changes to configuration.nix. Note I disabled everything relating to X on the basis of switching to a “pure” Wayland setup (but that may have been an error)
  • Ran nixos-rebuild switch and rebooted
# KDE Plasma 6
services.desktopManager.plasma6.enable = true;
services.displayManager.sddm.wayland.enable = true;

/*   # Disable all the X11 + Gnome stuff
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;
  # Stop gdm suspending the machine if nobody is logged in to the console
  services.xserver.displayManager.gdm.autoSuspend = false;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "gb";
    variant = "";
  }; */

Lots of download and rebuilding activity ran, but the end result was just a TTY login with no windowing system in sight.

I have no experience with Wayland, so no idea how to try to start the windowing system manually from the console (i.e. the equivalent of xstart) so my only option was to revert to an earlier generation.

Have I done something obviously silly?, and is there anything I can debug to see what’s gone wrong?

The answer in another thread Missing sddm.conf with KDE Plasma 6 and wayland helped me get Plasma 6 running

The recipe in the inital post seems to be missing a 3rd critical line. The example that works (just to get running) for me is:

# KDE Plasma 6
services.desktopManager.plasma6.enable = true;
# Enable SDDM, then enable Wayland support within SDDM(?)
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true; # required if no login diplay manager

/*   # Disable X11 + Gnome.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;
  # Stop gdm suspending the machine if nobody is logged in to the console
  services.xserver.displayManager.gdm.autoSuspend = false;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "gb";
    variant = "";
  }; */

However the keymap is wrong in Plasma, as it’s defaulting to the US keyboard layout. I assume services.xserver.xkb is not the way to configure wayland, so there’s still some config options to track down.

I read somewhere on a KDE (non-NixOS) forum that SDDM respected the system settings in /etc/default/locale. However I set the system locale to en_GB.UTF-8 during installation, but that’s not being picked up by SDDM in this setup.

Update- I couldn’t find a way to configure the keymap/locale for Plasma6 declaratively.

However if you use the KDE System Settings/Keyboard/Layouts option and create a single new layout (English(UK) in my case) this seems to be taken as the system default layout, solving the problem.

I am normally using a “special” keymap (workman) which I was configuring like so:

services.xserver.xkb = {
  layout = "us";
  variant = "workman";
};

Now I cannot do that anymore I have a normal us keyboard for my password (works fine for me and my password luckily) and then Plasma has my keymap configured.

From my quick research rn the relevant code to enable the keymap is both used by wayland and x11 and could be refactored to not be behind the services.xserver collection similar to how displayManager was moved out of the xserver collection a few months back.

https://bbs.archlinux.org/viewtopic.php?pid=1477202#p1477202

I am not yet comfortable enough to work on such low-level components, but I could open an issue.

Tryin’ to update to 24.05 and plasma 6 gets a session without workspace (desktop) I can run Chrome, because it starts with the Plasma/Wayland.

Looks like the windowManager isn’t starting with it.

Looked into journalctl and didn’t found any relevant register.

Also, plasma 5 is behaving same as 6 after upgrade.

Also, my GPU is not a NVidia onde. It is a Radeon

Has someone faced same issue?


configuration.nix

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, lib, ... }:

   # Install DroidCam and needed v4l2loopback
   #  let v4l2loopback-dc = config.boot.kernelPackages.callPackage ./v4l2loopback-dc.nix { };
   #      droidcam = pkgs.callPackage ./droidcam.nix {};
   #  in {
   #    boot.extraModulePackages = [ v4l2loopback-dc ];
   #     environment.systemPackages = [ droidcam ];
   #   }

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      # Enable the KDE Desktop Environment.
      ./users-configuration.nix
      ./local-configuration.nix
      ./wjjunyor-configuration.nix
      ./x-configuration.nix
      ./networking-configuration.nix
      # Sets-up the Home Manager
      # "${home-manager}/nixos"
    ];

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = false;
  # Uses the most recent packages.
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.kernelParams = [ "amd_iommu=on" "iommu=1" "rd.driver.pre=vfio-pci" ];   #If host = T101 or T800
  boot.kernelModules = [ "kvm-amd" "tap" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" "v4l2loopback" "snd-aloop" "amdgpu" "dm-snapchot" ]; # "hid-nintendo" #If host = T101 or T800
  boot.extraModprobeConfig = ''#If host = T101 or T800 
	options vfio-pci ids=vendorid:deviceid,vendorid:deviceid 
	options v4l2loopback nr_devices=2 exclusive_caps=1,1,1,1,1,1,1,1 video_nr=0,1 card_label=v4l2lo0,v4l2lo1
        ''; 

  # Teste ZFS 
  # boot.initrd.supportedFilesystems = [ "zfs" ];
  # boot.supportedFilesystems = [ "zfs" ];
  # boot.zfs.enableUnstable = false;
  # services.zfs.autoScrub.enable = true;
  # services.zfs.autoSnapshot.enable = true;
  # services.zfs.autoSnapshot.frequent = 8;
  # services.zfs.autoSnapshot.monthly = 1;
  # services.zfs.trim.enable = true;

  # Supposedly better for the SSD.
  fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];

  # Use the GRUB 2 boot loader.
  boot.loader.grub.enable = true;
  # boot.loader.grub.version = 2;     %%% DEPRECATED %%%
  # boot.loader.grub.backgroundColor = "#7EBAE4";
  boot.loader.grub.device = "nodev";
  boot.loader.grub.efiSupport = true;
  boot.loader.efi.canTouchEfiVariables = true;
  # Grub menu is painted really slowly on HiDPI, so we lower the
  # resolution. Unfortunately, scaling to 1280x720 (keeping aspect
  # ratio) doesn't seem to work, so we just pick another low one.
  boot.loader.grub.gfxmodeEfi = "1024x768";
  boot.loader.grub.enableCryptodisk = true;
  boot.initrd.luks.devices = {
    "root" = {
    device = "/dev/disk/by-uuid/209d5369-c671-4d18-adc2-a97e58c5bb69";
    preLVM = true;
    allowDiscards = true;
    };
  };
  
 
  # Select internationalisation properties.

  console.earlySetup = true;
  console.font = "Lat2-Terminus16";   
  console.keyMap = "br-abnt2";
  # i18n.defaultLocale = "pt_BR.UTF-8/UTF-8";
  # i18n.supportedLocales = [
  #   "all"
  #   "pt_BR.UTF-8/UTF-8"
  #   "en_GB.UTF-8/UTF-8"
  #   "es_ES.UTF-8/UTF-8"
  #   "fr_FR.UTF-8/UTF-8"
  #   "zh_CN.UTF-8/UTF-8"
  #   "C.UTF-8/UTF-8"
  # ];
  # i18n.extraLocaleSettings = {
  #   LANGUAGE = "pt_BR";
  #   LC_ALL = "";
  #   LC_ADDRESS = "pt_BR.UTF-8";
  #   LC_IDENTIFICATION = "pt_BR.UTF-8";
  #   LC_MEASUREMENT = "pt_BR.UTF-8";
  #   LC_MONETARY = "pt_BR.UTF-8";
  #   LC_NAME = "pt_BR.UTF-8";
  #   LC_NUMERIC = "pt_BR.UTF-8";
  #   LC_PAPER = "pt_BR.UTF-8";
  #   LC_TELEPHONE = "pt_BR.UTF-8";
  #   LC_TIME = "pt_BR.UTF-8";  
  # };
  i18n.inputMethod.fcitx5.plasma6Support = true;
 
  # Set your time zone.
  time.timeZone = "America/Campo_Grande";

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  programs.mtr.enable = true;
  programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
  programs.bash.enableCompletion = true;
  programs.nix-index.enableBashIntegration = true;
  programs.zsh.enableBashCompletion = true;
  
  # List services that you want to enable:

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Team Viewer Listener
  services.teamviewer.enable = false;

  # Teste Hardware ZFS 
  # HARDWARE
  hardware.bluetooth.enable = true;
  hardware.cpu.amd.updateMicrocode = true;
  hardware.opengl.driSupport = true;
  hardware.opengl.driSupport32Bit = true;
  hardware.opengl.enable = true;
  hardware.opengl.extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ];
  hardware.pulseaudio.support32Bit = true;
  hardware.pulseaudio.zeroconf.discovery.enable = true;
  hardware.pulseaudio.zeroconf.publish.enable = true;
  hardware.sane.enable = true;

  # Enable sound.
  # sound.enable = true;
  hardware.pulseaudio.enable = true;
  powerManagement.enable = true;

  # This value determines the NixOS release with which your system is to be
  # compatible, in order to avoid breaking some software such as database
  # servers. You should change this only after NixOS release notes say you
  # should.
  system.stateVersion = "23.11"; # Did you read the comment?
  
  # Auto upgrade Always ON.
  system.autoUpgrade.enable = true;

  # Garbage Collection Automation and Disk Usage Otimization
  nix.gc.automatic = true;
  nix.gc.dates = "weekly";
  nix.gc.options = "--delete-older-than 30d";
  nix.settings.auto-optimise-store = true;
  nix.extraOptions = ''
    min-free = ${toString (100 * 1024 * 1024)}
    max-free = ${toString (1024 * 1024 * 1024)}
  '';
  services.journald.extraConfig = ''
    SystemMaxUse=2G
  '';

  # Fundamental core packages
  environment.systemPackages = with pkgs; 
   [ # Basic command line tools
     bash
     zsh
     wget
     file
     # gksu
     glibcLocalesUtf8
     git
     hdf5
     zip
     unzip
     htop
     yle-dl
     youtube-dl
     # Tool for searching files/binaries from Nix packages
     nix-index
     dnsutils
     whois
     coreutils
     vbetool
     killall
     nethogs
     unrar
     # Gamin: a file and directory monitoring system
     fam
     # Basic image manipulation and handling stuff
     imagemagick
     ghostscript
     # Text editors
     vim
     # system clipboard support for vim
     xclip
     # VPN
     pptp
     openvpn
     # File format conversions
     pandoc
     pdf2svg
     # Screen brightness and temperature
     redshift
     # SSH filesystem
     sshfs-fuse
     # Yet another dotfile manager
     yadm
     # Password hash generator
     mkpasswd
     # Android
     jmtpfs
     gphoto2
     libmtp
     mtpfs
     nix-prefetch-git
     # Make NTFS filesystems (e.g., USB drives)
     ntfs3g
     # GUI for sound control
     pavucontrol
     # Bluetooth Support
     bluez
     # bluezFull # 20230213 Deprecated
     bluez-tools
     # Precisamos dele 
     pinentry-qt
     fontconfig
     glibcLocales
   ];
}

x-configuration.nix

{ pkgs, lib, ... }: 

{
   #Open ports for KDE Connect
   networking.firewall.allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
   networking.firewall.allowedUDPPortRanges = [ { from = 1717; to = 1764; } ];
  
   # Enable touchpad support.
   services.libinput.enable = true;
 
   # Enable the X11 windowing system.
   services.xserver.enable = true;
   # services.xserver.desktopManager.plasma5.enable = true; 

   # Use Plasma 6 w/ Wayland
   services.displayManager.defaultSession = "plasma";
   services.displayManager.sddm.enable = true;
   services.displayManager.sddm.theme = "breeze";
   services.displayManager.sddm.wayland.enable = true;
   services.desktopManager.plasma6.enable = true;
   services.desktopManager.plasma6.enableQt5Integration = false;
 
   # Window Manager
   programs.sway.enable = true;
   programs.sway.wrapperFeatures.gtk = true;
   # programs.hyprland.enable = true;
   # programs.hyprland.xwayland.enable = true;
   
   programs.dconf.enable = true;
 
   environment.sessionVariables = {
    KWIN_COMPOSE = "O2";
    KWIN_OPENGL_INTERFACE = "egl"; 
    NIXOS_OZONE_WL = "1";
   };
 
   # Keyboard settings on X
   # services.xserver.xkb.layout = "br";
   # services.xserver.xkb.variant = "abnt2";
 
   # Video backwards compatibility 
   hardware.opengl.driSupport32Bit = true;

   # Scanner settings
   services.ipp-usb.enable = true;
   hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];
   hardware.sane.brscan5 ={
     enable = true; 
     netDevices = {
       "MFP M130fw@CDQ/EscritÃrio" = { model = "MFP M130fw"; ip = "192.168.0.13"; };
       "SL-M4070FR@Adufms/Jornalismo" = { model = "SL-M4070FR"; ip = "192.168.0.150"; };
     };
   };
   # Online acoounts integration
   security.pam.services.sddm.enableKwallet = true;

   environment.variables.SSO_PLUGINS_DIR = ["/run/current-system/sw/lib/signon"];
   environment.variables.SSO_EXTENSIONS_DIR = ["/run/current-system/sw/lib/signon/extensions"];
   
   nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
   programs.kdeconnect.enable = true;
   programs.chromium.enable = true;
   # programs.firefox.enable = true;   
   # programs.firefox.package = [ ]; -----------------------> IMPLEMENTAR

   # Fonts Settings.   
   fonts.fontDir.enable = true;
   fonts.enableDefaultPackages = true;
   fonts.enableGhostscriptFonts = true;
   fonts.fontconfig.enable = true;
   fonts.packages = with pkgs;
    [ dina-font
      fira-code
      fira-code-symbols
      font-awesome 
      freefont_ttf 
      gentium 
      inconsolata
      liberation_ttf 
      liberation-sans-narrow 
      libertine
      # mplus-outline-fonts
      noto-fonts
      noto-fonts-cjk
      noto-fonts-emoji
      open-sans 
      proggyfonts
      source-code-pro  
      symbola 
      ttf_bitstream_vera 
      ubuntu_font_family 
      unifont 
      ibm-plex
    ];
   
   #  Define how gpg will deal with pinentry" 
   programs.gnupg.agent = {
     enable = true;
     pinentryPackage = lib.mkForce pkgs.pinentry-qt;
   };

   # User packages for graphic environment.
   environment.systemPackages = with pkgs; with qt5; with libsForQt5; 
    [ kdePackages.plasma-desktop 
      wayland-utils
      kdePackages.kpeople
      kdePackages.wayland
      kdePackages.zanshin
      kdePackages.skanlite
      kdeFrameworks.kactivities
      kdeFrameworks.kactivities-stats
      # Password manager for KDE
      kdeFrameworks.kwallet 
      kdeFrameworks.kcmutils
      kdeFrameworks.kconfigwidgets
      kdeFrameworks.kio
      kdeFrameworks.kconfig      
      kdeFrameworks.bluez-qt
      kdeFrameworks.plasma-framework
      # This is needed for graphical dialogs used to enter GPG passphrases
      kdeplasma-addons
      
      # Plasma System Settings 
      kdePackages.systemsettings
      kdePackages.libkscreen
      kdePackages.kdecoration
      khotkeys
      kdePackages.libksysguard	
      kdePackages.plasma-nm
      kdePackages.plasma-pa
      polkit-kde-agent
      kdePackages.powerdevil
      kdePackages.sddm-kcm
      plasma-browser-integration
      plasma-integration
      plasma-desktop
      plasma-workspace
      libsForQt5.ksystemlog      
      libsForQt5.plasma-browser-integration
      xwaylandvideobridge
      glxinfo
      vulkan-tools
      playerctl
      wayland-utils
      aha

      # Screenshots
      kdeApplications.spectacle
      kdeApplications.kwalletmanager
      # Printing and scanning
      kdeApplications.print-manager
      kdeApplications.dolphin-plugins
      kdeApplications.kio-extras
      kdeApplications.knotes
      # Desktop sharing tool
      kdeApplications.krfb              
      kdeApplications.kaccounts-providers   
      kdeApplications.kaccounts-integration
      # kdeApplications.signon-kwallet-extension # 20230213 Missing
      kdeApplications.calendarsupport
      kdeApplications.eventviews
      kdeApplications.kcalutils

      # KDE apps
      kinfocenter
      kscreen
      konsole
      kcalc
      kfind
      kwalletcli
      # Allow automatic unlocking of kwallet if the same password. This seems to work without installing kwallet-pam.
      kwallet-pam
      # ssh-add prompts a user for a passphrase using KDE. Not sure if it is used by anything? ssh-add just asks passphrase on the console.
      ksshaskpass
      # GPG manager for KDE
      kgpg
      # Text editor
      kate
      # Archives (e.g., tar.gz and zip)
      ark
      # Browsers
      chromium
      dolphin
      # Office Suit
      libreoffice
      # Spell checker 
      sonnet
      	aspellDicts.en
      	aspellDicts.es
      	aspellDicts.fr
      	aspellDicts.pt_BR
      # Document readers
      okular
      # Media player
      pacman
      unrar
      # Player de Video
      vlc
      # PDF Handler
      pdfsam-basic

      kio-gdrive    
      signond                     
      xdg-desktop-portal-kde
      qoauth
      #gdrivefs
      aha
    ];
  }

journalctl
journalctl-lastday.log