macbook: add keyboard backlight key bindings and permissions

- Add XF86KbdBrightnessUp/Down keybindings (Macbook-only) using swayosd
  for consistent OSD behaviour with screen brightness and volume
- Enable hardware.acpilight for udev rules allowing video group to write
  to /sys/class/leds/ (keyboard backlight)
- Add fred to the video group so brightnessctl/swayosd can write backlight values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-17 12:58:06 +01:00
parent 1d491f4bd2
commit cdb4cbd6c0
3 changed files with 8 additions and 1 deletions

View file

@ -24,6 +24,10 @@
boot.loader.systemd-boot.configurationLimit = 5;
boot.initrd.systemd.enable = true;
# Allow video group (fred) to write to /sys/class/backlight and /sys/class/leds
# (screen brightness and keyboard backlight)
hardware.acpilight.enable = true;
services.logind.settings.Login = {
HandleLidSwitch = "suspend";
HandleLidSwitchExternalPower = "suspend";

View file

@ -312,6 +312,9 @@ in
", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
", XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
", XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
] ++ lib.optionals isMacbook [
", XF86KbdBrightnessUp, exec, swayosd-client --keyboard-brightness raise"
", XF86KbdBrightnessDown, exec, swayosd-client --keyboard-brightness lower"
];
bindl = [

View file

@ -11,7 +11,7 @@
users.users.fred = {
isNormalUser = true;
description = "fred";
extraGroups = [ "networkmanager" "wheel" "docker" ];
extraGroups = [ "networkmanager" "wheel" "docker" "video" ];
packages = lib.optionals
(lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ])
(with pkgs; [ bazaar ]);