-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
mba6x_bl: init at 2016-02-12 #13688
mba6x_bl: init at 2016-02-12 #13688
Conversation
By analyzing the blame information on this pull request, we identified @edolstra, @bjornfor and @offlinehacker to be potential reviewers |
services.mba6x_bl = { | ||
enable = mkEnableOption "mba6x_bl"; | ||
}; | ||
}; |
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.
This will appear somewhat cryptic to readers of the man page, is it possible to provide a more descriptive name/docs?
Oops, i screwed up. Let med restore this.. |
@joachifm : I changed the description based on your feedback. |
Great. I'd like to get some feedback from others before merging this, though. Feel free to ping me if it ends up lingering for too long. |
wantedBy = [ "multi-user.target" ]; | ||
serviceConfig = { | ||
Type = "oneshot"; | ||
ExecStart = "/bin/sh -c \"${modprobe} -r mba6x_bl && ${modprobe} mba6x_bl\""; |
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.
Please use script
instead of calling sh
yourself. It's documented over here: https://nixos.org/nixos/manual/options.html#opt-systemd.services._name_.script
Adding a whole module for a temporary workaround feels kinda wrong. Does this bug also occur when the module isn't auto loaded (by blacklisting it) but loaded manually or does it always need to be loaded twice to work? |
@hrdinka Thanks for your feedback. I will add fixes soon. I don't know if it can be justified to make it a module. The driver can be loaded by users by setting |
Ok I see. So it's not only for the workaround. Then it might fit better as an extra option below |
It seems weird to relate the mba6x driver to the light utility. How do they relate other than being in the domain of background light? |
Hm, what about the |
@joachifm that was my second idea. This option shouldn't be placed in services. @simonvandel yes you are right. I fast fired. Technically it does not refer to the light program at all. I just like the idea of having it somewhere where it belongs instead of adding another top level option for a specific device that might be unnecessary in future. Something like:
|
This seems more appropriate. |
It would be nice to have a general framework for these kind of hardware specific packages. Another alternative is to leave the actual driver be in nixpkgs, but drop the module support. The use of the driver could then be documented in something like https://github.com/ehmry/nixos-hardware. |
Or a more general hardware support and fixing scheme:
|
@simonvandel thank's for the link, didn't know that. That's actually what my last propose would do under the hood. |
My previous idea is a bad one. An entry for every device out there isn't practical and is absolutely impossible to maintain. I guess for your cause your last post shows the best solution. Just keep the package and add some documentation about its existence and the workaround. The bug itself is hopefully fixed soon upstream. |
Suggestion: if the driver is useful on its own, submit a separate PR for it, then we can figure out how to best expose it to users later. |
This driver fixes backlight after suspend/resume on Macbook Air 6,1 and 6,2. Added a workaround for patjak/mba6x_bl#43 in form of a systemd service. Has been working great on my machine for at least a month now.
I updated this PR to only include the packaging of the driver, and implemented the feedback received. Is this merge-able? I will add some documentation to https://github.com/ehmry/nixos-hardware when I get the time. |
It looks to be in keeping with similar packages already in the tree. If it's useful to you, it's sure to be useful to someone else. Thank you for your efforts. |
Hello, |
@huacayacauh did you try #13688 (comment) |
@joachifm thanks. Yes, in this case nixos-rebuild tells me that kernel variable is undefined. I don't know what I should substitute kernel for, my tries gave "attribute mba6x_bl missing". |
I think you'd need to refer to |
@joachifm |
Oh, I see you're running 15.09; this is not available there. |
It won't be in a release channel for a while. The earliest you'll get it is when the nixos-unstable channel becomes unstuck. Alternatively, you can clone NixOS/nixpkgs-channels at the release branch you want and cherry-pick the commit onto it. I won't go into details here, see the manual. |
@joachifm Ok, thank you very much for the quick answer. |
Things done:
nix-build --option build-use-chroot true
or nix.useChroot on NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)This driver fixes backlight after suspend/resume on Macbook Air 6,1
and 6,2.
Added a workaround for patjak/mba6x_bl#43 in
form of a systemd service.
Has been working great on my machine for at least a month now.