Searching basic but working 24.05 Plasma6 config file

Hi there!

I’m new to NixOS.

I’ve installed NixOS besides my Manjaro KDE installation on my Lenovo ThinkPad P16v Gen1 laptop. The Calamares installer failed for me, probably because it doesn’t support installing on an existing luks+btrfs setup. So I followed the (very nicely written) manual installation guide at NixOS Manual which got me a working bootloader that manages to get me to a (much too tiny not highdpi-screen aware) login screen. Sadly, from there I don’t manage to enter the Plasma6 desktop I think I’ve installed. It just freezes upon entering a correct user+password combination. I’ve tried both the Wayland and the X11 sessions from the drop-down but both just make the login screen hang (I still can move the mouse pointer). When choosing the X11 session the mouse pointer changes to that “typical old looking” X-Symbol.

I’m able to switch to a TTY session from the login manager and used this to set my users password, since I didn’t see how to do that in the manual installation guide, which only prompted me to set root’s password.

Below the modified config files originially generated by nixos-generate-config:

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, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).

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

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

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.efiSysMountPoint = "/boot/efi";
  boot.loader.efi.canTouchEfiVariables = true;

  # networking.hostName = "nixos"; # Define your hostname.
  # Pick only one of the below networking options.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
  networking.networkmanager.enable = true;  # Easiest to use and most distros use this by default.

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

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

  # Select internationalisation properties.
  # i18n.defaultLocale = "en_US.UTF-8";
  # console = {
  #   font = "Lat2-Terminus16";
  #   keyMap = "us";
  #   useXkbConfig = true; # use xkb.options in tty.
  # };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # https://nixos.wiki/wiki/KDE
  # use KDE Plasma 6 on 24.05
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  environment.plasma6.excludePackages = with pkgs.kdePackages; [
    plasma-browser-integration
    oxygen
  ];

  # Using the following example configuration, QT applications will have a look similar to the GNOME desktop, using a dark theme.
  qt = {
    enable = true;
    platformTheme = "gnome";
    style = "adwaita-dark";
  };

  # Configure keymap in X11
  # services.xserver.xkb.layout = "us";
  # services.xserver.xkb.options = "eurosign:e,caps:escape";

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

  # Enable sound.
  # hardware.pulseaudio.enable = true;
  # OR
  services.pipewire = {
    enable = true;
    pulse.enable = true;
  };

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

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.user = {
    isNormalUser = true;
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
    packages = with pkgs; [
      firefox
      thunderbird
      smplayer
      audacity
      gimp
      htop
      dool
      ncdu
      keepassxc
      remmina
      #nextcloud-desktop
      #tree
    ];
  };

  # 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;

  # Copy the NixOS configuration file and link it from the resulting system
  # (/run/current-system/configuration.nix). This is useful in case you
  # accidentally delete configuration.nix.
  system.copySystemConfiguration = true;

  # This option defines the first version of NixOS you have installed on this particular machine,
  # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
  #
  # Most users should NEVER change this value after the initial install, for any reason,
  # even if you've upgraded your system to a new NixOS release.
  #
  # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
  # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
  # to actually do that.
  #
  # This value being lower than the current NixOS release does NOT mean your system is
  # out of date, out of support, or vulnerable.
  #
  # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
  # and migrated your data accordingly.
  #
  # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
  system.stateVersion = "24.05"; # Did you read the comment?

}

hardware-configuration.nix

# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" "rtsx_pci_sdmmc" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/e67ffd5a-0077-48c8-9d27-c3788244e48d";
      fsType = "btrfs";
      options = [ "subvol=@nixos_root" ];
    };

  boot.initrd.luks.devices."luks-adbda9bc-3558-4216-b878-a217c0279fd3".device = "/dev/disk/by-uuid/adbda9bc-3558-4216-b878-a217c0279fd3";

  fileSystems."/home" =
    { device = "/dev/disk/by-uuid/e67ffd5a-0077-48c8-9d27-c3788244e48d";
      fsType = "btrfs";
      options = [ "subvol=@nixos_home" ];
    };

  fileSystems."/var/log" =
    { device = "/dev/disk/by-uuid/e67ffd5a-0077-48c8-9d27-c3788244e48d";
      fsType = "btrfs";
      options = [ "subvol=@nixos_log" ];
    };

  fileSystems."/var/cache" =
    { device = "/dev/disk/by-uuid/e67ffd5a-0077-48c8-9d27-c3788244e48d";
      fsType = "btrfs";
      options = [ "subvol=@nixos_cache" ];
    };

  fileSystems."/boot/efi" =
    { device = "/dev/disk/by-uuid/4428-1A76";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

  swapDevices = [ ];

  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

I’ve found that on my first try I stupidly mounted the log subvolume to both /var/log & /var/cache - maybe that caused some problems…

I’ve corrected it and updated the system by rerunning nixos-install but that didn’t get me much further. I was able to reach a desktop session without any panels (and some crash log windows), though I was able to start Konsole using the Ctrl+Alt+T shortcut and starting firefox from it - but had no connection and didn’t want to manually connect to wifi using the terminal.

Now I’ve deleted all my nixos subvolumes and started over, but I suspect there’s problems with my configuration.nlx file - Is there a good 24.05 plasma6 sample somewhere? Maybe one that get’s me something close to what the KDE installer ISO gives me? with correct High-DPI-Scaling and Network-Manager GUI component?

UPDATE: after restarting without that mistake I found: didn’t make any difference in the behaviour of the system. I guess NixOS doesn’t work for my laptop or not without having the magical correct config file for it… I guess I’ll stick to my Manjaro setup until I get / find some better info how to approach a NixOS setup.

Consider trying the nixpkgs-unstable channel, instead.

does the installer use unstable? I want a stable system, and the graphical installer boots up and offers a perfectly working desktop (besides no sound), I want just that (to start with) - only without the installation related stuff. Is that possible somehow? I’ve tried looking at the /etc/nixos/configuration.nix of the installer system but that seems to be a hugely complex import tree…

So what I’m looking for is a simple but working plasma6 configuration.nix file I can copy and use as a basis for customizing my system, instead of starting from a this non functional thing I’ve came up with reading the docs.

I suspect a driver problem. What’s the hardware here? (Specifically GPU)

Check the journal around the log in attempt in for errors (ideally paste it somewhere).

1 Like

It’s one of those Intel+Nvidia dual GPU laptops, the details my Manjaro system has on them:

Graphics:
  Device-1: Intel Raptor Lake-P [UHD Graphics] vendor: Lenovo driver: i915
    v: kernel alternate: xe arch: Gen-13 process: Intel 7 (10nm) built: 2022+
    ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4, DP-5, HDMI-A-1
    bus-ID: 00:02.0 chip-ID: 8086:a720 class-ID: 0300
  Device-2: NVIDIA GA107GLM [RTX A1000 6GB Laptop GPU] vendor: Lenovo
    driver: nvidia v: 555.58.02 alternate: nouveau,nvidia_drm non-free: 550.xx+
    status: current (as of 2024-06; EOL~2026-12-xx) arch: Ampere code: GAxxx
    process: TSMC n7 (7nm) built: 2020-2023 pcie: gen: 4 speed: 16 GT/s
    lanes: 8 link-max: lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:25bc
    class-ID: 0302

About the logs:
I have a 285.4KiB big file @ “/var/log/lastlog” but it’s a not an ascii encoded binary…
Can I convert this to readable plain-text from another system with the NixOS’s disk mounted?

Ah, nvidia. That’s where the problem lies in like half the cases on this forum.

On the Manjaro system, you’re using the proprietary driver but you don’t appear to have configured it in your NixOS config. (This sort of remote debugging is quite a superpower of NixOS.)

The journal (system log) is inspected using journalctl on systemd distributions such as NixOS. Consult the man page or your favourite tutorial for more details.

1 Like

Thank you for taking the time to talk to me :slight_smile:

I know that journalctl is used to read those compressed logs while the system is active, but I haven’t found a parameter that could be used to parse a different systems compressed logs at a specified path instead of the currently booted one.

UPDATE2: found this, will try it next time I find a need:

journalctl --file /path/to/some/file.journal

Thanks for the hint that I’m probably missing Nvidia driver. I thought it should also work using the CPU-integrated Intel graphics, but I’ll try to find Nvidia NixOS config snippets that enable non-free drivers and see if that helps the installed NixOS system to work similar to the GUI installer ISO.

UPDATE: currently reading Nvidia - NixOS Wiki

Okey, so I’ve now put together this nvidia.nix file:

# https://nixos.wiki/wiki/Nvidia
{ config, lib, pkgs, ... }:
{
  nixpkgs.config.allowUnfree = true;

  # Enable OpenGL
  hardware.opengl = {
    enable = true;
  };

  # Load nvidia driver for Xorg and Wayland
  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {

    # Modesetting is required.
    modesetting.enable = true;

    # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
    # Enable this if you have graphical corruption issues or application crashes after waking
    # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
    # of just the bare essentials.
    powerManagement.enable = false;

    # Fine-grained power management. Turns off GPU when not in use.
    # Experimental and only works on modern Nvidia GPUs (Turing or newer).
    powerManagement.finegrained = false;

    # Use the NVidia open source kernel module (not to be confused with the
    # independent third-party "nouveau" open source driver).
    # Support is limited to the Turing and later architectures. Full list of
    # supported GPUs is at:
    # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
    # Only available from driver 515.43.04+
    # Currently alpha-quality/buggy, so false is currently the recommended setting.
    open = false;

    # Enable the Nvidia settings menu,
    # accessible via `nvidia-settings`.
    nvidiaSettings = true;

    prime = {
        offload = {
            enable = true;
            enableOffloadCmd = true;
        };
        # Make sure to use the correct Bus ID values for your system!
        intelBusId = "PCI:0:2:0";
        nvidiaBusId = "PCI:1:0:0";
        # amdgpuBusId = "PCI:54:0:0"; For AMD GPU
    };

    # Optionally, you may need to select the appropriate driver version for your specific GPU.
    package = config.boot.kernelPackages.nvidiaPackages.stable;
  };
}

with which I succeeded to rebuild my system. Sadly, even after a reboot to this new config the plasma desktop is just as broken as before.

I’ve used the opportunity when I had it booted into TTY (desktop is unusable) to save the systemlog to a plain-text format by redirecting journalctl output to a text file:

before the nvidia drivers: Aug 03 20:08:52 nixos kernel: microcode: updated early: 0x410e -> 0x4121, date = - Pastebin.com

with nvidia drivers: Aug 03 20:26:35 nixos kernel: microcode: updated early: 0x410e -> 0x4121, date = - Pastebin.com

According to the logs, plasma shell is crashing in both scenarios but the logs don’t have any details and I’m not even sure they crash before the session is stopped. I’d check out the coredumps now.

how can / should I acquire and present them here?

You can’t/shouldn’t. You have to look at i.e. the backtrace contained within to get an idea what might be going wrong but we’re getting near the limits of what people who are not KDE developers can do here.

I’d recommend you to try a few different desktop environments, including lightweight ones to narrow down the root cause.

Okey. What I find strange is that all of the below work just fine on this laptop:

  • NixOS 24.05 Plasma6 installer
  • NixOS 23.11 Plasma5 installer (UPDATE: sorry that was a different laptop, haven’t tried it on this one…)
  • Manjaro KDE Plasma6 (installer & installed version)

What desktop do you suggest I should try? Would love it if you could give me a simple snippet to put into my configuration.nix file for it…

Something other than KDE. GNOME, sway, x11+i3, whatever.

okey, so I tried XFCE by replacing
services.desktopManager.plasma6.enable = true;
with
services.xserver.desktopManager.xfce.enable = true;

which worked a bit better than plasma6, still no network manager gui and also the high-dpi scaling was very bad.

next I tried plasma5:
services.xserver.desktopManager.plasma5.enable = true;
which worked in X11 mode, but not with Wayland which is what I really want because of it’s much nicer high-dpi scaling.

The plasma5 X11 desktop was the first that allowed me to configure the wifi using a network manager GUI though. But it’s also very buggy. For example the wallpaper choosing GUI crashes when switching from image to color and trying to change the default blue color by clicking on it.

Is this really something hardware related or is just nobody on NixOS using plasma desktops and therefore it’s just a really buggy not well packaged mess?

For now I guess I’ll have to stick to Manjaro - I love the idea of NixOS but if it can’t give me a simple working plasma+wayland config to start with where not every app crashes after a few clicks - it just seems it’s not yet workable for me. I can’t spend hundreds of hours building my own desktop.

Note that you can have multiple desktops enabled at the same time and switch the one you want from the login screen.

Not crashing is a whole lot better than a “bit” if you ask me. This tells us there isn’t any general issue with X11 or graphical.

Was that with or without the proprietary driver? Does it work in the other case aswell?

Have you tried any wayland compositors other than kwin? Please try at least Mutter (GNOME) and wlroots (sway, Hyprland, River, …).

This should not be happening. Anything interesting appearing in the logs when you do that?

I can assure you Plasma is working perfectly fine for a ton of people. In fact, you claimed that it’s working on your machine in the live ISO too.


I have a hunch that there’s some on-disk state making Plasma crash. Could you create a new user with an empty home and log into Plasma6 as that user?

I left the nvidia config in place, so with them, haven’t tried without.

I have no experience with them and a strong distaste for GNOME since it’s version 3 release. But sure, if I find some time I’ll try them.

yeah, that’s what’s most baffling to me. That the installer shows this well working plasma6 + wayland (at least it looked like wayland from the beautiful high-dpi scaling, didn’t verify though) on the same hardware, but installed it’s absolute bonkers.

I’ll check in the next days. gotta go to sleep now and have to do paid work tomorrow.

I did delete and recreate the /home/user directory a few times, is there some additional value in creating a new user or shouldn’t that suffice?

Are there other paths of local state that I could try to clear?

I think it was this:

Aug 04 16:13:16 nixos .plasmashell-wr[4218]: No GSettings schemas are installed on the system
Aug 04 16:13:17 nixos systemd-coredump[4308]: [🡕] Process 4218 (.plasmashell-wr) of user 1000 dumped core.

or maybe this?

Aug 05 20:12:13 nixos plasmashell[1565]: kf.coreaddons: “Could not find plugin org.kde.desktopcontainment”
Aug 05 20:12:13 nixos plasmashell[1565]: Error loading KCM: “Could not find plugin org.kde.desktopcontainment”
Aug 05 20:12:13 nixos plasmashell[1565]: kf.coreaddons: “Could not find plugin org.kde.plasma.folder”
Aug 05 20:12:13 nixos plasmashell[1565]: Error loading KCM: “Could not find plugin org.kde.plasma.folder”
Aug 05 20:12:13 nixos plasmashell[1565]: kf.coreaddons: “Could not find plugin org.kde.plasma.folder”
Aug 05 20:12:13 nixos plasmashell[1565]: Error loading KCM: “Could not find plugin org.kde.plasma.folder”
Aug 05 20:12:13 nixos plasmashell[1565]: file:///nix/store/bv2cypm51imhdqxcn6rd86kv0zp9zi31-plasma-desktop-5.27.11/share/plasma/shells/org.kde.plasma.desktop/contents/configuration/ConfigurationContainmentAppearance.qml:210: TypeError: Cannot read property ‘objectName’ of null
Aug 05 20:12:13 nixos plasmashell[1565]: kf.coreaddons: “Could not find plugin org.kde.color”
Aug 05 20:12:13 nixos plasmashell[1565]: Error loading KCM: “Could not find plugin org.kde.color”
Aug 05 20:12:13 nixos plasmashell[1565]: kf.coreaddons: “Could not find plugin org.kde.image”
Aug 05 20:12:13 nixos plasmashell[1565]: Error loading KCM: “Could not find plugin org.kde.image”
Aug 05 20:12:13 nixos plasmashell[1565]: kf.coreaddons: “Could not find plugin org.kde.image”
Aug 05 20:12:13 nixos plasmashell[1565]: Error loading KCM: “Could not find plugin org.kde.image”

That’s a coredump again.

That looks like more of a bug but this is plasma5. Try plasma6.