Laptop hangs at "Started Session c1 of User gdm."

Within the last day when booting my laptop, the system gets to the following and hangs:

[ OK ] Started Session c1 of User gdm.

I don’t recall adding any packages that could interfere, and my other systems function normally.

I can access my system by using the prior NixOS configuration 109. I have attempted to

nix-channel --update 
sudo nix flake update 
sudo nixos-rebuild switch --flake .#

and it appears to successfully build without any issue (yesterday and today). However, configurations 110 from yesterday and 111 from today boot up to the same spot and never progress past it.

Here’s my latest flake configuration for reference:

Thanks in advance for your help!

Did you check the log (via journalctl, pass -D /{mount-point}/var/log/journal if you use a live usb to read the log of your main system.)? I don’t use gdm but my computer also “hangs” after updating nixpkgs from 126f49a01de5b7e35a43fd43f891ecf6d3a51459 to 5a05160f7671434e1c833b1b01284b876e04eca4. From the log I learned that systemd udev service hangs, so the keyboard doesn’t work. I could still ssh to it, though.


I can use one of the available ttys to log-in.

Thanks. Looks like I need to hang tight as it is being worked on?

  1. roll-back to an earlier generation and use that for now, or
  2. wait for that PR to hit unstable: , or
  3. using a local nixpkgs checkout of nixos-unstable, cherry-pick the commit mentioned in the PR on top and build against that

another workaround, easiest of all

  hardware.opengl.mesaPackage = pkgs.mesa_22;

Note that you should remove this workaround once the PR above hits unstable to prevent further issues like this in the future.


For anyone else having this issue, this is what I did:

  1. Used @uep’s solution to temporarily set mesa to 22
  2. Made a tempfix.nix file with links to this discourse and @peterhoeg’s link to the PR, so I can easily keep track of the status. Using his suggestion #2.
  3. I will remove the tempfix.nix and link from my flake per @Atemu’s comment once it hits unstable.

You can see my flake using the link earlier in this topic.

Also, another temporary fix would be to do something like this:

# list generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system

 109   2023-03-26 20:19:33   
 110   2023-03-28 21:02:51   
 111   2023-03-29 13:11:47   (current)

# switch to a prior working generation
sudo nix-env --profile /nix/var/nix/profiles/system --switch-generation 109

switching profile from version 111 to 109

Thanks everyone!

1 Like

pkgs.mesa will most likely be a bit longer-valid way for your override than pkgs.mesa_22.

1 Like

I tried using pkgs.mesa instead of pkgs.mesa_22 in my tempfixes.nix file:

{ config, pkgs, ... }:  

  # Temporarily Fixes the following.
  # TODO Remove once the PR hits unstable
  hardware.opengl.mesaPackage = pkgs.mesa;

but receive this error when I try to build:

error: The option `hardware.opengl.mesaPackage' does not exist. Definition values:
       - In `/nix/store/1v7ysf98ig51sa6512lpai6alv5bfi8f-source/hosts/local/weda/tempfixes.nix': <derivation mesa-22.3.7>

So I reverted back to mesa_22 for now.

On nixpkgs master, mesa_23 is the default now (for several minutes).

1 Like

Update: I was able to fully remove this temporary fix and reboot my system after a rebuild.

lol- and I thought I was bleeding edge.

Regardless, the issue seems to have been fixed as I removed my temporary fix line of code and my system boots fine now. Thank you for the suggestion though!

hello, i am facing this issue.
i have tried above mentioned solutions.

after addinig this : hardware.opengl.mesaPackage = pkgs.mesa;
in tempfix.nix file i am getting this error

i have figured out that if i apply this nvidia configuration then i am getting this issue : Nvidia - NixOS Wiki.
if i remove it. it works fine.

but i need nvidia graphics applied.

also another thing is this is only coming on my laptop screen.
have found out that my laptop is connected with my external monitor i can see the ui and i can login it easily but the laptop screen is stuck on the above-mentioned message.

please help i am new to nixos

@uep @peterhoeg

As the error message says, there is no hardware.opengl.mesaPackage option. Where did you get that from? There is hardware.nvidia.package though.

But maybe better to open a new issue as your problem is different from OP’s.

mesaPackage was an option for a short while on unstable but it was quickly removed again because it didn’t work out like we thought it would.

Your issue sounds like one of the countless issues with iGPU + Nvidia dGPU in laptops and I don’t think we as the Linux community can really do anything about that since it’s all Nvidia proprietary crap. You’d have to ask Nvidia to fix it and I doubt they care.

@peterhoeg @Atemu
i am able to solve this issue with some configuration of nvdia .
thanks .
the Nvidia config that I applied might help someone.


thank you. nixos looks very awesome …!!

1 Like

I had the same issue after setting environment.sessionVariables.XDG_CONFIG_HOME in configuration.nix.