Cannot control display brightness in NixOS 23.05

After upgrading from NixOS 22.11 to NixOS 23.05, my laptop display brightness stays at maximum brightness. Invoking light outputs the warning

No backlight controller was found, so we could not decide an automatic target. The current command will have no effect. Please use -L to find a target and then specify it with -s.

When comparing the output of light -L with NixOS 22.11 (Kernel 5.x) with NixOS 23.05 (Kernel 6.1.31), I see that the following lines are missing in NixOS 23.05:

 	sysfs/backlight/amdgpu_bl0
 	sysfs/backlight/auto

Did somebody have the same problem? Could you solve it?

There already is an issue for this: upgrading 22.11 -> 23.05 removes everything from `/sys/class/backlight` · Issue #225902 · NixOS/nixpkgs · GitHub

Have you tried using brightnessctl instead of light?

1 Like

I solved it by running nixos-generate-config again and using the new generated hardware config. Probably the following line in the old autogenerated hardware config caused the problem with kernel versions > 6.?:

boot.kernelParams = ["amdgpu.backlight=0" "acpi_backlight=none"];
2 Likes

Same solution here, I had to remove "acpi_backlight=none" from my boot.kernelParams list to make it work