fix(nb): escape % in brightnessctl battery udev rule #116
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!116
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/nb-udev-brightnessctl-percent"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes a build-time failure on nb's 26.05 upgrade.
Root cause
NixOS 26.05 (systemd 260) runs
udevadm verifyas a build-time gate on the assembled udev rules. nb's on-battery rule contained a bare%:udev treats
%as a format-specifier introducer, so40%is invalid. That failsudev-rules.drv→system-units→etc→ the wholenixos-system-nb-01-26.05build (the cascade seen in bento-upgrade logs).Regression from #114 (light→brightnessctl): the old
light -S 40had no%. Eval (test-configuration) cannot catch this —udevadm verifyonly runs at build time.Fix
brightnessctl set 40%%— udev expands%%→%, so brightnessctl still receives40%. Added a comment so it is not reverted.Verification
Built nb's
udev-rulesderivation locally with the fix:49 udev rules files checked, Success: 49, Fail: 0(wasFail: 1). Pre-commit eval green (nb-only change).Relates to #102 (nb 26.05 reboot/verify).
NixOS 26.05 (systemd 260) runs `udevadm verify` as a build-time gate. The on-battery rule's `brightnessctl set 40%` contains a bare %, which udev parses as a format specifier ("invalid substitution type"), failing udev-rules.drv and cascading to the whole system build. Escape it as %% so udev passes a literal 40% to brightnessctl. Regression from the #114 light->brightnessctl migration (old `light -S 40` had no %). Verified: udev-rules builds clean (49 files, 0 fail).