Problems booting after update

tldr: I upgraded from 24.11.711815.1807c2b91223 (Linux 6.6.67) to 24.11.713099.67e9c8808988 (Linux 6.6.71) and my pc only properly finishes booting sometimes.

Ever since doing sudo nixos-rebuild switch --upgrade I’ve had this issue where, after selecting the new generation and the computer showing a bunch of fast text, I end up with a black screen with nothing on it.

Restarting and trying to boot the same generation multiple times would rarely result in the computer reaching the kde login screen.

Since I could consistently boot in an older generation, I assumed there was something wrong in my configuration.nix, so I started stripping it more and more to see if the pc would finally boot properly. I ended up with basically a “stock” config, only leaving the packages under environment.systemPackages = with pkgs; [ and it still didn’t work

I humbly ask for your help in fixing this issue.

In case they are needed, here are my system details from the newest working generation:
Operating System: NixOS 24.11
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.6.67 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7800X3D 8-Core Processor
Memory: 30,5 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7E12
System Version: 1.0

Can you boot the system to failure (black screen) with the new generation once, then reboot and go into the old generation that works, and then get the previous boot’s logs with:

journalctl --boot -1 -x

I forgot to mention that I waited a bit to make this post to see if a newer update would fix the issue so the Os version I’m currently trying to boot is 24.11.713321.6a3ae7a5a12f (Linux 6.6.72).

Hello
Have you disabled secure boot? Because in the log it says

gen 19 17:01:32 nixos kernel: Secure boot enabled

second of all can you go in the tty/change the tty?
and could you share your configuration.nix?

Secure boot is enabled in the bios. It worked fine so far so it never occurred to me that there are extra steps to make that work… I’m just now reading about Lanzaboote

I can go in tty. To reboot after I got stuck on the black screen I brought it up with ctrl + alt + f2, logged in and sudo reboot now

# 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, ... }:
#Enable software center
let
  nix-software-center = import (pkgs.fetchFromGitHub {
    owner = "snowfallorg";
    repo = "nix-software-center";
    rev = "0.1.2";
    sha256 = "xiqF1mP8wFubdsAQ1BmfjzCgOD3YZf7EGWl9i69FTls=";
  }) {};
  hid-tmff2 = config.boot.kernelPackages.callPackage ./modules/hid-tmff2.nix {};
in

{
  boot.blacklistedKernelModules = [ "hid-thrustmaster" ];
  boot.extraModulePackages = [ hid-tmff2 ];
  boot.kernelModules = [ "hid-tmff2" ];
  # Use boot.kernelModules = [ hid-tmff2 ]; to enable the module. Then, the user can load it using:
  # $ sudo modprobe hid-tmff2
  # OR use "" to autoload the module at startup

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

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

  networking.hostName = "nixos"; # 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;

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

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

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

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;
  services.xserver.videoDrivers = [ "amdgpu" ];
  services.xserver.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma6.enable = true;

  #Test
  services.xrdp.enable = true;
  services.xrdp.defaultWindowManager = "startplasma-x11";
  services.xrdp.openFirewall = true;

  #Enable flatpack
  services.flatpak.enable = true;
  systemd.services.flatpak-repo = {
    wantedBy = [ "multi-user.target" ];
    path = [ pkgs.flatpak ];
    script = ''
      flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    '';
  };

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

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

  # Configure console keymap
  console.keyMap = "it2";

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

  # use the example session manager (no others are packaged yet so this is ena
  # 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.dinnerbug = {
    isNormalUser = true;
    description = "My actual name and surname which I'd like to keep private";
    extraGroups = [ "networkmanager" "wheel" "scanner" "lp" ];
    packages = with pkgs; [
      kdePackages.kate
    #  thunderbird
    ];
  };

  # Remove sound.enable or set it to false if you had it set previously, as sound.enable is only meant for ALSA-based configurations

  # rtkit is optional but recommended
  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;
  };

  #Enable kdeconnect
  programs.kdeconnect.enable = true;

  # Install firefox.
  programs.firefox.enable = true;

  #Install steam
  programs.steam.enable = true;
  programs.steam.gamescopeSession.enable = true;

  #Enable gamemode
  programs.gamemode.enable = true;

  #Install alvr
  programs.alvr = {
    enable = true;
    package = pkgs.alvr;
    openFirewall = true;
  };

  #Enable openrgb
  services.hardware.openrgb.enable = true;

  #Tailscale
  services.tailscale.enable = true;

  # create a oneshot job to authenticate to Tailscale
  systemd.services.tailscale-autoconnect = {
    description = "Automatic connection to Tailscale";

    # make sure tailscale is running before trying to connect to tailscale
    after = [ "network-pre.target" "tailscale.service" ];
    wants = [ "network-pre.target" "tailscale.service" ];
    wantedBy = [ "multi-user.target" ];

    # set this service as a oneshot job
    serviceConfig.Type = "oneshot";

    # have the job run this shell script
    script = with pkgs; ''
      # wait for tailscaled to settle
      sleep 2

      # check if we are already authenticated to tailscale
      status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)"
      if [ $status = "Running" ]; then # if so, then do nothing
        exit 0
      fi

      # otherwise authenticate with tailscale
      ${tailscale}/bin/tailscale up -authkey tskey-auth-"my key which I'd like to keep private"
    '';
  };

  # Enable the user service
  systemd.user.services.openrgb-profile.enable = true;

  #Enable opengl
  hardware.graphics = {
  enable = true;
  #driSupport = true;
  #driSupport32Bit = true;

  # Add extra OpenGL packages
  extraPackages = with pkgs; [
    rocmPackages.clr.icd
  ];
  };

  #Mullvad
  services.mullvad-vpn.enable = true;
  services.mullvad-vpn.package = pkgs.mullvad-vpn;
  services.resolved.enable = true;

  #Scanner
  hardware.sane.enable = true; # enables support for SANE scanners
  hardware.sane.extraBackends = [ pkgs.epsonscan2 ];

  # 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
    nix-software-center
    btop
    mangohud
    goverlay
    openrgb
    wget
    spotify
    vlc
    sidequest
    furmark
    lm_sensors
    libsForQt5.kalk
    bottles
    lutris
    ryujinx
    zoom-us
    gimp
    wine
    heroic
    git
    pkgs.vesktop
    pipewire
    prismlauncher
    (pkgs.python3.withPackages (python-pkgs: with python-pkgs; [
      spyder
      jupyter
    ]))
    rclone
    yt-dlg
    yt-dlp
    audacity
    pkgs.tailscale
    joystickwake
    google-chrome
    ventoy
    zapzap
    inkscape-with-extensions
    gpu-screen-recorder
    gpu-screen-recorder-gtk
    i2c-tools
    stress-ng
    unigine-heaven
    monero-gui
    xmrig-mo
    clinfo
    bottom
    nsz
    davinci-resolve
    baobab
    fastfetch
    xsane
    libinsane
    epsonscan2
    normcap
    kdePackages.kcolorchooser
    eyedropper
    scrcpy
    android-tools
    lact
    protonup-qt
    linuxHeaders
    oversteer
    hid-tmff2
    ente-auth
    shadps4
  ];

  # 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 = {
    enable = true;
    allowedTCPPorts = [ ports I'd rather keep private ];
    allowedTCPPortRanges = [ { ports I'd rather keep private; } ];
    allowedUDPPorts = [ ports I'd rather keep private ];
    allowedUDPPortRanges = [
    { ports I'd rather keep private; }
    { ports I'd rather keep private; }
    { ports I'd rather keep private; }
    ];
  };

  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # 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 = "24.05"; # Did you read the comment?

  systemd.services.loginrgb = {
    after = [ "suspend.target" ];
    wantedBy = [ "suspend.target" ];
    serviceConfig = {
      Type = "oneshot";
      ExecStart = "/run/current-system/sw/bin/bash /home/dinnerbug/scripts/loginrgb.sh";
    };
  };

  hardware.bluetooth.enable = true; # enables support for Bluetooth
  hardware.bluetooth.powerOnBoot = false; # powers up the default Bluetooth controller on boot

  #LACT
  systemd.services.lact = {
    description = "AMDGPU Control Daemon";
    after = ["multi-user.target"];
    wantedBy = ["multi-user.target"];
    serviceConfig = {
      ExecStart = "${pkgs.lact}/bin/lact daemon";
    };
    enable = true;
  };

  systemd.services.NetworkManager-wait-online.enable = false;

}


The only time I remember disabling secure boot was when I was first installing NixOS. After I finished the install, I re-enabled it. I have since updated a couple times and nothing went wrong despite secure boot being on.

I don’t quite understand how secure boot affects installs, updates etc…

can you try starting kde from the tty with kstart plasma-desktop or if this won’t work with startx.
The thing with secure boot is that it some times causes problems especially while booting. But if you can get in the tty it seams like thats a problem with the displaymanager.

[dinnerbug@nixos: 1$ kstart plasma-desktop
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: From 6.5.0, xch-cursore or libxcb-cursor is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application nay fix this problem.

Available platform plugins are: minimal, minimalegl, xcb, eglfs, linuxfb, offscreen, ukkhrdisplay, unc, wayland, wayland-egl.

Aborted (core dumped)
[dinnerbug@nixos: 1$ startx

The program 'startx' is not in your PATH. You can make it available in an ephemeral shell by typing: nix-shell -p xorg.xinit

Just in case I tried running startx in the ephemeral shell, which led to this screen.

Let me know if there is anything else I can do to help you help me :slight_smile:

Can you post the output of following commands after you booted into the blackscreen: journalctl -fu display-manager.service
journalctl --boot -1
Then could you try to restart sddm sudo systemctl restart sddm.service

[dinnerbug@nixos:˜]$ journalctl -fu display-manager.service
gen 19 19:49:44 nixos sddm[1266]: Socket server starting...
gen 19 19:49:44 nixos sddm[1266]: Socket server started.
gen 19 19:49:44 nixos sddn[1266]: Loading theme configuration from "/run/current-system/sw share/sddn/themes/breeze/theme.conf"
gen 19 19:49:44 nixos sddn[1266]: Greeter starting...
gen 19 19:49:44 nixos sddn-helper[1373]: Detected locale "C" with character encoding "AMSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead. If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
gen 19 19:49:44 nixos sddn-helper[1373]: [PAM] Starting...
gen 19 19:49:44 nixos sddn-helper [1373]: [PAM] Authenticating...
gen 19 19:49:44 nixos sådn-helper[1373]: [PAM] returning.
gen 19 19:49:44 nixos sddm[1266]: Greeter session started successfully
gen 19 19:49:45 nixos sddn[1266]: Message received from greeter: Connect

Output of journalctl --boot -1 :

Results of trying sudo systemctl restart sddm.service :

[dinnerbug@nixos:˜]$ systemctl restart sddn.service

==== AUTHENTICATING FOR org.freedesktop.systendi.manage-units =====

Authentication is required to restart 'sddm.service'

Authenticating as: Name Surname (dinnerbug)

Password:

==== AUTHENTICATION COMPLETE ====

Failed to restart sddm.service: Unit sddn.service not found.

Ignore me, you shared two. Yep, sddm is just crashing, but not writing anything to the journal to help debug this: gist:443658c19809ab0e5c05c765aaed5c44 · GitHub

Not too familiar with the whole plasma business, so I’m not sure how to/if you can dig up logs for this.

maybe try running sddm in wayland. Just put following in you config:

services.displayManager.sddm.wayland.enable = true;

Also writing sddm right could work

You wrote sddn :upside_down_face:

I added services.displayManager.sddm.wayland.enable = true; and it didn’t solve the issue.

Silly me :sweat_smile:. I tried punching it in again, this time making sure it was typed correctly, and it gave me the same message, only this time it said sddm and not sddn

Can you post the following output:

cat ~/.local/share/sddm/wayland-session.log

also could you try a different displaymanager. Just comment the lines for sddm and add:

services.displayManager.ly.enable = true;

cat ~/.local/share/sddm/wayland-session.log doesn’t return anything.

services.displayManager.ly.enable = true; worked on 4 reboot attempts. I selected plasma (wayland) and logged in consistently every time.

This would mean that the other login screen is “borked” in some way? I assume by now you have a suspicion on what the problem might be and I’d be curious to know what you think.

yeah so definitely a problem with your displaymanager. I think it is a wayland/x problem.
If the cat ~/.local/share/sddm/wayland-session.log doesn’t return anything it means that sddm is running on x. Maybe post the content of the files in ~/.local/share/sddm/.
Also i noticed that you have defined display manager and kde plasma two times in your config.
So try removing this part and see if it works.

you already got it there:

~/.local/share/sddm/ has 2 log files in it: wayland-session.log and xorg-session.log. Both are empty.

As for the double declaration, when troubleshooting my config I made a copy and started removing and changing stuff, including that. When nothing seemed to work I just restored the old config. It was redundant though so thank you regardless for pointing it out.

sddm-greeter-qt6[1410]: Adding view for "DP-3" QRect(0,0 1920x1080)

says in your journalctl log. How many Monitors have you connected and where did you connect them?

1 monitor, display port on my gpu. Third port from the left.

Just in case, I tested a reboot with the cable on the first port, but the new “barebones” login screen appears instead of the usual kde login screen, despite having commented services.displayManager.ly.enable = true; and uncommented services.displayManager.sddm.enable = true;

ok try setting dislplaymanager ly.enabel to false and do a rebuild.
When it works take a look in the logging directory for sddm again and post the logs if they are not empty.
Also try setting sddm wayland to false by following:

services.displayManager.sddm.wayland.wayland.enable = false;