Xdg Desktop Portal For KDE failed to start error

Hi all,

just starting out on my NixOS journey and I’ve been slowly learning and tinkering, however I have an error every time the system boots resulting in a core dump and for the life of me I haven’t manage to work out how to fix it.

This is is the error:

Aug 15 21:12:08 nixos-system76 systemd[1137]: Failed to start Xdg Desktop Portal For KDE.
Aug 15 21:12:08 nixos-system76 systemd-coredump[1183]: [🡕] Process 1179 (.xdg-desktop-po) of user 175 dumped core.
                                                       
                                                       Module libxcb-util.so.1 without build-id.
                                                       Module libxkbcommon-x11.so.0 without build-id.
                                                       Module libICE.so.6 without build-id.
                                                       Module libSM.so.6 without build-id.
                                                       Module libxcb-xinput.so.0 without build-id.
                                                       Module libxcb-xkb.so.1 without build-id.
                                                       Module libxcb-xinerama.so.0 without build-id.
                                                       Module libxcb-xfixes.so.0 without build-id.
                                                       Module libxcb-sync.so.1 without build-id.
                                                       Module libxcb-shape.so.0 without build-id.
                                                       Module libxcb-render.so.0 without build-id.
                                                       Module libxcb-render-util.so.0 without build-id.
                                                       Module libxcb-randr.so.0 without build-id.
                                                       Module libxcb-shm.so.0 without build-id.
                                                       Module libxcb-image.so.0 without build-id.
                                                       Module libxcb-icccm.so.4 without build-id.
                                                       Module libX11-xcb.so.1 without build-id.
                                                       Module libQt5XcbQpa.so.5 without build-id.
                                                       Module libqxcb.so without build-id.
                                                       Module libmp3lame.so.0 without build-id.
                                                       Module libmpg123.so.0 without build-id.
                                                       Module libogg.so.0 without build-id.
                                                       Module libopus.so.0 without build-id.
                                                       Module libvorbisenc.so.2 without build-id.
                                                       Module libvorbis.so.0 without build-id.
                                                       Module libFLAC.so.12 without build-id.
                                                       Module libsndfile.so.1 without build-id.
                                                       Module libbrotlicommon.so.1 without build-id.
                                                       Module libpulsecommon-16.1.so without build-id.
                                                       Module libgraphite2.so.3 without build-id.
                                                       Module libsystemd.so.0 without build-id.
                                                       Module libkeyutils.so.1 without build-id.
                                                       Module libkrb5support.so.0 without build-id.
                                                       Module libcom_err.so.3 without build-id.
                                                       Module libk5crypto.so.3 without build-id.
                                                       Module libkrb5.so.3 without build-id.
                                                       Module libcap.so.2 without build-id.
                                                       Module libpcre2-8.so.0 without build-id.
                                                       Module libexpat.so.1 without build-id.
                                                       Module libbrotlidec.so.1 without build-id.
                                                       Module libXdmcp.so.6 without build-id.
                                                       Module libXau.so.6 without build-id.
                                                       Module liblzma.so.5 without build-id.
                                                       Module libbz2.so.1 without build-id.
                                                       Module libpulse-mainloop-glib.so.0 without build-id.
                                                       Module libpulse.so.0 without build-id.
                                                       Module libGLdispatch.so.0 without build-id.
                                                       Module libXext.so.6 without build-id.
                                                       Module libGLX.so.0 without build-id.
                                                       Module libzstd.so.1 without build-id.
                                                       Module libpcre2-16.so.0 without build-id.
                                                       Module libicudata.so.73 without build-id.
                                                       Module libicuuc.so.73 without build-id.
                                                       Module libicui18n.so.73 without build-id.
                                                       Module libharfbuzz.so.0 without build-id.
                                                       Module libpng16.so.16 without build-id.
                                                       Module libdbus-1.so.3 without build-id.
                                                       Module libgssapi_krb5.so.2 without build-id.
                                                       Module libKF5DBusAddons.so.5 without build-id.
                                                       Module libKF5Crash.so.5 without build-id.
                                                       Module libudev.so.1 without build-id.
                                                       Module libz.so.1 without build-id.
                                                       Module libfreetype.so.6 without build-id.
                                                       Module libfontconfig.so.1 without build-id.
                                                       Module libQt5Svg.so.5 without build-id.
                                                       Module libxcb-keysyms.so.1 without build-id.
                                                       Module libXfixes.so.3 without build-id.
                                                       Module libxcb.so.1 without build-id.
                                                       Module libattr.so.1 without build-id.
                                                       Module libacl.so.1 without build-id.
                                                       Module libKF5Archive.so.5 without build-id.
                                                       Module libffi.so.8 without build-id.
                                                       Module libdbusmenu-qt5.so.2 without build-id.
                                                       Module libQt5X11Extras.so.5 without build-id.
                                                       Module libphonon4qt5.so.4 without build-id.
                                                       Module libgcc_s.so.1 without build-id.
                                                       Module libstdc++.so.6 without build-id.
                                                       Module libGL.so.1 without build-id.
                                                       Module libxkbcommon.so.0 without build-id.
                                                       Module libQt5Core.so.5 without build-id.
                                                       Module libQt5Gui.so.5 without build-id.
                                                       Module libQt5DBus.so.5 without build-id.
                                                       Module libKF5CoreAddons.so.5 without build-id.
                                                       Module libKF5AuthCore.so.5 without build-id.
                                                       Module libQt5Xml.so.5 without build-id.
                                                       Module libQt5Network.so.5 without build-id.
                                                       Module libQt5Concurrent.so.5 without build-id.
                                                       Module libKF5I18n.so.5 without build-id.
                                                       Module libKF5ConfigCore.so.5 without build-id.
                                                       Module libKF5Service.so.5 without build-id.
                                                       Module libKF5KIOCore.so.5 without build-id.
                                                       Module libQt5Qml.so.5 without build-id.
                                                       Module libQt5QmlModels.so.5 without build-id.
                                                       Module libQt5Quick.so.5 without build-id.
                                                       Module libKF5Solid.so.5 without build-id.
                                                       Module libQt5Widgets.so.5 without build-id.
                                                       Module libKF5Auth.so.5 without build-id.
                                                       Module libKF5Codecs.so.5 without build-id.
                                                       Module libKF5ConfigGui.so.5 without build-id.
                                                       Module libKF5WidgetsAddons.so.5 without build-id.
                                                       Module libQt5WaylandClient.so.5 without build-id.
                                                       Module libKF5GuiAddons.so.5 without build-id.
                                                       Module libKF5ConfigWidgets.so.5 without build-id.
                                                       Module libKF5ItemViews.so.5 without build-id.
                                                       Module libQt5PrintSupport.so.5 without build-id.
                                                       Module libKF5IconThemes.so.5 without build-id.
                                                       Module libKF5GlobalAccel.so.5 without build-id.
                                                       Module libKF5XmlGui.so.5 without build-id.
                                                       Module libKF5Bookmarks.so.5 without build-id.
                                                       Module libKF5Completion.so.5 without build-id.
                                                       Module libKF5JobWidgets.so.5 without build-id.
                                                       Module libX11.so.6 without build-id.
                                                       Module libKF5WindowSystem.so.5 without build-id.
                                                       Module libKF5KIOGui.so.5 without build-id.
                                                       Module libKF5KIOWidgets.so.5 without build-id.
                                                       Module libKF5KIOFileWidgets.so.5 without build-id.
                                                       Module libKF5Package.so.5 without build-id.
                                                       Module libQt5QuickWidgets.so.5 without build-id.
                                                       Module libKF5WaylandClient.so.5 without build-id.
                                                       Module libKF5Notifications.so.5 without build-id.
                                                       Module libKF5Declarative.so.5 without build-id.
                                                       Module .xdg-desktop-portal-kde-wrapped without build-id.
                                                       Stack trace of thread 1179:
                                                       #0  0x00007f16deea1adc __pthread_kill_implementation (libc.so.6 + 0x87adc)
                                                       #1  0x00007f16dee52cb6 raise (libc.so.6 + 0x38cb6)
                                                       #2  0x00007f16dee3c8ba abort (libc.so.6 + 0x228ba)
                                                       #3  0x00007f16df499cd7 _ZNK14QMessageLogger5fatalEPKcz (libQt5Core.so.5 + 0x99cd7)
                                                       #4  0x00007f16dfb26d5b _ZN22QGuiApplicationPrivate25createPlatformIntegrationEv (libQt5Gui.so.5 + 0x126d5b)
                                                       #5  0x00007f16dfb27270 _ZN22QGuiApplicationPrivate21createEventDispatcherEv (libQt5Gui.so.5 + 0x127270)
                                                       #6  0x00007f16df6d2285 _ZN23QCoreApplicationPrivate4initEv (libQt5Core.so.5 + 0x2d2285)
                                                       #7  0x00007f16dfb2a15c _ZN22QGuiApplicationPrivate4initEv (libQt5Gui.so.5 + 0x12a15c)
                                                       #8  0x00007f16e1576559 _ZN19QApplicationPrivate4initEv (libQt5Widgets.so.5 + 0x176559)
                                                       #9  0x0000000000425701 main (.xdg-desktop-portal-kde-wrapped + 0x25701)
                                                       #10 0x00007f16dee3dace __libc_start_call_main (libc.so.6 + 0x23ace)
                                                       #11 0x00007f16dee3db89 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x23b89)
                                                       #12 0x0000000000425a35 _start (.xdg-desktop-portal-kde-wrapped + 0x25a35)
                                                       
                                                       Stack trace of thread 1181:
                                                       #0  0x00007f16def1477f __poll (libc.so.6 + 0xfa77f)
                                                       #1  0x00007f16dec43fde g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0x5dfde)
                                                       #2  0x00007f16dec440fc g_main_context_iteration (libglib-2.0.so.0 + 0x5e0fc)
                                                       #3  0x00007f16df7240e6 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x3240e6)
                                                       #4  0x00007f16df6ca143 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2ca143)
                                                       #5  0x00007f16df4d4277 _ZN7QThread4execEv (libQt5Core.so.5 + 0xd4277)
                                                       #6  0x00007f16e01e54b7 _ZN22QDBusConnectionManager3runEv (libQt5DBus.so.5 + 0x194b7)
                                                       #7  0x00007f16df4d564c _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xd564c)
                                                       #8  0x00007f16dee9fe24 start_thread (libc.so.6 + 0x85e24)
                                                       #9  0x00007f16def219b0 __clone3 (libc.so.6 + 0x1079b0)
                                                       ELF object binary architecture: AMD x86-64

Ive tried installing libsForQt5.xdg-desktop-portal-kde just in case and enabling like this,

xdg.portal = {
    enable = true;
    extraPortals = [ pkgs.xdg-desktop-portal-kde ];
  };

although I’m not sure this is the correct way as it was adapted from the sway NixOS wiki entry.

Apart from the error the system works as expected

here is my 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, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.timeout = 3;
  boot.plymouth.enable = true;

  networking.hostName = "nixos-system76"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;
  # Enable latest kernel 
  boot.kernelPackages = pkgs.linuxPackages_latest;

  # enable bluetooth support
  hardware.bluetooth.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_GB.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_GB.UTF-8";
    LC_IDENTIFICATION = "en_GB.UTF-8";
    LC_MEASUREMENT = "en_GB.UTF-8";
    LC_MONETARY = "en_GB.UTF-8";
    LC_NAME = "en_GB.UTF-8";
    LC_NUMERIC = "en_GB.UTF-8";
    LC_PAPER = "en_GB.UTF-8";
    LC_TELEPHONE = "en_GB.UTF-8";
    LC_TIME = "en_GB.UTF-8";
  };

  # Enable AMD GPU
  boot.initrd.kernelModules = [ "amdgpu" ];
  services.xserver.videoDrivers = [ "amdgpu" ];
  hardware.opengl.extraPackages = with pkgs; [
   rocm-opencl-icd
   rocm-opencl-runtime
   amdvlk
  ];
  hardware.opengl.driSupport  = true;

  # Enable the KDE Plasma Desktop Environment.
  services.xserver.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma5.enable = true;
  # Enable the X11 windowing system.
  services.xserver.enable = true;
 
  # Configure keymap in X11
  services.xserver = {
    layout = "us";
    xkbVariant = "";
  };

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

  # Enable sound with pipewire.
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.greylinux = {
    isNormalUser = true;
    description = "my_name";
    extraGroups = [ "networkmanager" "wheel" "cdrom" "dialout" ];
    packages = with pkgs; [
      firefox
      kate
      freetube
      gparted
      libsForQt5.kalendar
      discord
      htop
      libsForQt5.kcalc
      libsForQt5.kdeconnect-kde
      libreoffice
      picard
      prusa-slicer
      vlc
      clinfo
      nextcloud-client
      duf
      ncdu
      bat
      tldr
      exa
      wget
      unzip
      neofetch
    #  thunderbird
    ];
  };

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
  ];
  # 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;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;
  networking.enableIPv6 = false;
  networking.firewall = {
    enable = true;
    allowedTCPPortRanges = [
      { from = 1714; to = 1764; } 
     ];
    allowedUDPPortRanges = [
      { from = 1714; to = 1764; }
     ];
    };

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "23.05"; # Did you read the comment?

}

any advice or direction on where to look , would be great

thanks in advance

Installed xfce instead , it works a lot better , this must be a KDE thing.