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
illum: init at 0.4 #22175
illum: init at 0.4 #22175
Conversation
@dancek, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @offlinehacker and @bjornfor to be potential reviewers. |
Apparently I'll try to make the build use |
Strange. I enabled |
This version uses |
|
||
config = mkIf cfg.enable { | ||
|
||
environment.systemPackages = [ pkgs.illum ]; |
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 probably shouldn't be necessary? Or do you have to map your keys to use an "illum client"?
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.
I thought that's needed to mark the dependency on the illum
package.
There's no need to map keys or anything like that. Illum just works, but there will probably be some configurable options in the future.
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.
No the serviceConfig.ExecStart = "${pkgs.illum}/bin/illum-d";
is enough for that, this would just add the binaries to the path for all users.
It's been a while, but here's yet another version that explicitly uses I removed the unnecessary |
pkgs/tools/system/illum/default.nix
Outdated
sha256 = "05v3hz7n6b1mlhc6zqijblh1vpl0ja1y8y0lafw7mjdz03wxhfdb"; | ||
}; | ||
|
||
buildInputs = [ bash pkgconfig ninja libevdev libev ]; |
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.
bash
is already part of stdenv
services.illum = { | ||
|
||
enable = mkOption { | ||
default = false; |
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 specify type = types.bool
here; there's no inference right now.
config = mkIf cfg.enable { | ||
|
||
systemd.services.illum = { | ||
description = "illum"; |
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 flesh out the description
a little bit.
|
||
systemd.services.illum = { | ||
description = "illum"; | ||
after = [ "basic.target" ]; |
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.
after = [ "basic.target" ]
is strictly unnecessary; it is the systemd default.
pkgs/tools/system/illum/default.nix
Outdated
buildInputs = [ bash pkgconfig ninja libevdev libev ]; | ||
|
||
configurePhase = '' | ||
bash ./configure |
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.
stdenv.shell
can be safely assumed to be bash
.
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.
Earlier Travis builds failed on the line set -eu -o pipefail
of the configure script, claiming pipefail is an invalid option. Pipefail is a bash extension, been around since bash 3 (2004). Therefore I assumed Travis builds with a POSIX shell (dash or such).
Is there a way to make Travis builds succeed while not explicitly running with bash?
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.
Hm, I see. Sounds like an impurity issue (if travis runs on ubuntu, /bin/sh
is dash
, I think). You could either patch the shebang of configure
(e.g., using the patchShebangs
helper in preConfigure
) or leave it as is; bash
ought to be available in the build environment without adding it to the build inputs, at any rate.
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.
I'll go with bash ./configure
then. The script incorrectly specifies #!/bin/sh
when it actually needs bash, so in my understanding patchShebangs
might not suffice there.
@joachifm thanks for the review. Here's another version with the requested changes implemented. I assume the Travis CI build will fail again because of |
I changed back to |
The build was successful and the requested changes have been implemented. Waiting for someone to merge this (or request other changes). |
Thank you |
Motivation for this change
There seemed to be no easy/automatic solution in NixOS to get the screen brightness adjustment keys working. At least in the case that BIOS doesn't handle them and you run a simplistic system without KDE/GNOME/XFCE. Illum is a simple daemon that listens to brightness keys and adjusts the screen backlight. Probably useful for other people, too.
Tested by running
nix-build -A 'config.systemd.units."illum.service".unit'
, copying the resulting service definition to/run/systemd/system
and running the service.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)