-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
brltty: 6.1 -> 6.3; nixos/brltty: use upstream units #114745
Conversation
Result of 3 packages built:
Result of 3 packages built:
|
homepage = "http://www.brltty.com/"; | ||
license = lib.licenses.gpl2; | ||
homepage = "https://brltty.app"; | ||
license = lib.licenses.gpl2Plus; | ||
maintainers = [ lib.maintainers.bramd ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could shorten this by using meta = with lib; {
This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 3 packages built:
The following issues got detected with the above build packages.
brltty:
Please consider this feature to be alpha. A substituteInPlace with an unmatched pattern got detected:
Please check the offending substituteInPlace for typos or changes in source. warning: stale-substitute warning: unclear-gpl Near pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix:158:5:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/unclear-gpl.md
|
Assertions can break overriding a package, see issue NixOS#73102.
@rnhmjoj Thanks for your work. I'm not using NixOS much these days so wasn't aware that upstream has very good systemd units by now. I just checked this with a braille display. The display does not get activated. Which journalctl or systemctl ouput should I check to debug this? |
@bramd Hi, I'm glad you're still using NixOS, even if not much. I would be really stuck without you, thank you. Uhm, it's possible the units templates don't play well with NixOS. Normally they are broken because they can't be installed declaratively, but here they are being started by udev, so I thought it could still work. Or maybe I missed some file that had to be installed manually. The starting process is actually pretty involved, it should work like this:
So, first I would try to confirm that the udev rule worked: you should check if your device is listed in the output of
Then,
can you check if they are created? |
@rnhmjoj OK, first of all the device is showing:
The brltty-device@ttyUSB0 unit is present, but doesn't seem to get activated:
Any ideas what to try next? |
That's strange: the creation of .device and activation of the brltty-device@ unit are done by the same rule, not sure how only one would fail. What does this outputs?
also, this could be useful:
|
Now this is weird, no reverse dependencies on the device, but it is in the dependency list of the brltty service:
|
Is there anything in the journal for |
@rnhmjoj No, it's completely empty |
Can you run |
I tried to reproduce the setup with a couple of fake units in a VM and the trick brltty is using seems to work: the final service is started at boot. A final option would be to run systemd in debug mode and check the logs. |
@rnhmjoj I had some time to investigate this further. It seems some generic USB device identifiers are commented in the udev rules and the braille display I used to test this uses one of those identifiers. So, therefore it didn't trigger. I added the following sed command to postInstall to uncomment those:
This is interesting, since just starting BRLTTY with the driver set to "auto" will detect these displays with a generic identifier. So, for users running my old version of this package without any additional configuration it may mean that they lose braille when upgrading. I'm not sure how we should handle this. Another issue is that the SupplementaryGroups for the brltty units contains pulse-access, a group that is not present on my NixOS system. This causes systemd to fail and not start the service. I just manually added this group for now and now I get the following output:
So, now it seems it is trying to start, but failing somehow. |
I turned on debug mode for systemd and found that this problem came from this script:
It tries to generate a brlapi key in /etc, which is only allowed by root it seems. After generating the key manually:
|
Thank you, I should have fixed this.
This is a group to control access to a system wide pulseaudio server, which is
We should probably ask about this too. |
Based on BRLTTY's docs and mailing list archive, the idea here is that a user might want to run a system-wide Pulseaudio daemon to have seamless BRLTTY speech/audio output in a real text console as well as in a graphical environment. BRLTTY itself does not interface directly to Pulseaudio and will just output to ALSA, which Pulse emulates. Since this is not really recommended/supported, this would be a custom setup by the user anyway. You might argue that NixOS should create this group if the systemwide option for Pulse is enabled, which is not the behavior now. If that was the case, we could conditionally enable this additional group membership. For now I commented it out.
Based on commit history and old mailing list posts the idea here is that the default option is very safe to just drop in a system. So, it will not mess with any other devices that match these generic identifiers, such as the FTDI usb-serial converters. Some distributions include this in their base installation, so most braille displays can work out of the box when plugged in. I think it is reasonable to be a bit more unsafe and include these braille devices, since the user asked to enable braille support explicitly. I changed the make options to do this. If we ever want to include this in NixOS live CDs/base installations, which would ease the installation dramatically for braille display users, we might want to use the safe version without the generic identifiers and add an option to switch between these versions. Speaking of options, would it be a good idea to rename the enabled option? We are not really just enabling/disabling a service anymore. Shouldn't it be something like I did not change the option naming, but sent a PR to you containing the other changes. |
- Use absolute paths to logger and udev. - Pass the absolute path to the brltty binary to the wrapper. - Include generic USB devices in udev rules. - Remove pulse-access group from systemd unit and sysusers.
Upstream has been providing a very thoroughly designed set of systemd units, udev and polkit rules. With these the brltty daemon is activated asynchronously via udev, runs as a dedicated user with runtime and state directories set up using systemd-tmpfiles. This is much better than the current unit, which runs a single instance as root and pulls in systemd-udev-settle to wait for the hardware.
I fixed an evaluation error found by ofBorg: utillinux has been renamed to util-linux. |
It's fine for me. Is there anything else to fix? I'd like to merge this before the feature freeze for NixOS 21.05. |
@rnhmjoj No, I've tried this with two different displays, even connecting them at the same time, which works great. So that's an improvement from the single service autodetecting a single display. Doing a quick test with a GNOME desktop I couldn't get braille to work in the Orca screenreader, but that was already broken before. Now we have the brlapi key file in place it at least has a chance of working for other clients that want to connect to the BRLTTY API. My Linux work is usually server stuff, so getting braille to work on the graphical desktop has not that much priority for me. Besides, that would probably need more changes across various packages to play well together. So, long story short, I think it's fine to merge this either with the name of the option changed as discussed above or not. I'm not that familiar with renaming/breaking options in NixOS. |
Ok, great to her that!
It can be done without breaking compatibility via a sort of alias, though I'd just keep it the way it is for now. Thank you again for helping out! |
Motivation for this change
Removing systemd-udev-settle as part of #73095.
Upstream has been providing a very thoroughly designed set of systemd units,
udev and polkit rules. With these the brltty daemon is activated
asynchronously via udev, runs as a dedicated user with runtime and state
directories set up using systemd-tmpfiles.
This is much better than the current unit, which runs a single instance
as root and pulls in systemd-udev-settle to wait for the hardware.
Things done
services.brltty.enable = true;