Need Advice: Trying to add support for Thinkpad X1 Carbon Gen13 Graphics

I have recently started using a Thinkpad X1 Carbon Gen13 with Sway and while it works I have noticed that my options in terms of display resolution are limited. Only the native resolution of 2880x1800 is avaliable which is quite tiny.

I’m not new to the Nix language having setup a few derivations in the past however I’m quite new to the intricacies of kernel driver and such-

I believe what I am missing is essentially the correct graphics definitions/drivers (pardon if this is not the correct term) and after some searching I found that Ubuntu users do seem to have it better after pulling this package

https://www.ubuntuupdates.org/package/core/noble/main/updates/oem-sutton-daisy-meta

There’s quite a bit of information in there including a link to launchpad with more information on the metapackage sources.

Is it feasible to add this to Nix in some way? I am willing to spend time figuring this out but am not sure where to start to be honest.

Essentially appreciate any pointer on the matter.

3 Likes

Have you looked at GitHub - NixOS/nixos-hardware: A collection of NixOS modules covering hardware quirks.?

I am running a X1 Carbon 12th gen with what’s likely the same OLED display, and it looks like I also only have 1 resolution available. I am on unstable and have the latest kernel in use.

$ hyprctl monitors all
Monitor eDP-1 (ID 0):
        2880x1800@120.00000 at 0x0
        description: Samsung Display Corp. 0x419F
        availableModes: 2880x1800@120.00Hz 2880x1800@60.00Hz

I’m using the Xe graphics driver:

boot.kernelParams = [ "i915.force_probe=!7d45" "xe.force_probe=7d45" ]

Anyway, the answer here is scaling. Most display panels don’t look great when run at anything other than their non-native resolution. In sway (and other Wayland compositors) monitors can be configured to use a scaling factor. I use 1.3 or 1.6 on my built-in display, depending on whether it’s docked or not.

1 Like

I neglected to mention this but yes I am in fact already using that.

Yeah. I have tried that. It solves the resolution issue but sadly I have had issues with scaling. More specifically, what I believe after some trial and error is that Firefox brings the laptop to a crawl, sometimes crashing completely and requiring a reboot and at the moment I believe it might have to do with scaling (though unconfirmed at the moment)

I don’t think my comment will help you but anyway. I am also using a X1 Gen 13, running wayland with the Niri compositor (which I really love). This is my actual settings:

Output "Samsung Display Corp. ATNA40HQ02-0  Unknown" (eDP-1)
  Current mode: 2880x1800 @ 60.000 Hz (preferred)
  Variable refresh rate: supported, disabled
  Physical size: 300x190 mm
  Logical position: 2560, 0
  Logical size: 1645x1028
  Scale: 1.75
  Transform: normal
  Available modes:
    2880x1800@60.000 (current, preferred)
    2880x1800@120.000

I am so happy with this laptop because everything works out of the box (sounds like an advertisement). The only issue I have, is that wake from sleep brings up the screen brightness to max. So everytime I unlock or boot the laptop, I have to bring down the brightness of the screen manually (end of advertisement) :wink:

1 Like

Yes. That’s the same I get. I’m fairly happy with the laptop but relying on scaling has not been much successful for me unfortunately.

I’m still look for information on how to approach the problem of introducing the same support Ubuntu has if anybody happens to know some pointers

@alethenorio can you share some of your hardware configuration? I have the same machine but I cannot get the xe driver to work, only 915.

I’ve used the following on a different system. Changing boot.kernelPackages may be overkill, but happened to help in my case.

This looks a bit hacky.
Have you tried the hardware repo yet? There’s a configuration for the X1 there.

It uses this for the iGPU:

No it’s not. I suggest reading the Arch Wiki.

My quoted post also provides another way to get the device ID.

Also looking at nixos-hardware, they’re doing what I do :wink:

Hello,

I just received my X1 Carbon Gen13 with a Lunar Lake CPU. I’m super happy of it, what a nice device (yes, a bit expensive!!!) !

In KDE, I can have to all the resolution, as shown in this screenshot:

You can find the laptop config here: infra/modules/hosts/x1c at master · drupol/infra · GitHub

The only think I had is that I had to use Kernel >= 6.17.0 because there was a bug in the latest kernel 6.16.

Hope this helps!

One note about that: loading a several thousand line long json file into nix, which we know to have terrible json parsing performance, may be overkill and slow. But if it works it works :slight_smile:

Are you referring to the facter.json file ?

Yeah, that’s the one. It gets fromJSONed.

OK good. TBH, I never saw any slowdown because of this file so far.

Nothing to add to this conversation besides that I’m still so happy with the laptop. Battery life is top notch and the display is so good.

1 Like

@alethenorio Thanks for raising attention to this problem. I don’t know any better about how to approach this, so I hope someone with such knowledge comes forward.

I can just confirm the problem: I just recently got mine (w/Lunar Lake), updated System BIOS to 1.19, made a clean NixOS 25.05 install with KDE plasma and linux 6.17.3. Then updated to 6.17.4 with the aforementioned hardware-profile.

  • I have access to a long array of different resolutions, and 120hz refresh rate for the native one only; this screen is awesome; can confirm 200% scaling works fine, but apparently for native wayland applications only; legacy X11 and some tray icons, on the other hand, do not.
  • Enabling the “Scaled by the system” option makes then look very grainy.
  • Moving to 1920x1200 improves size overall, and a 125% scaling is mostly fine; however, refresh rate is only available on 60 hz on this setting. The loss of smoothness is very noticeable.

Sorry for the late reply. You can find both the NixOS and Home Manager configurations here

I am actually using the hardware repo but I wasn’t aware there was a separate config for the GPU. I’ll look into that. Thank you

EDIT: Nevermind, I see now that the thinkpad config in there imports the gpu :frowning: