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
openrazer: init at 2.3.1 (driver, daemon, lib and NixOS module) #47009
Conversation
description = "An entirely open source driver and user-space daemon that allows you to manage your Razer peripherals on GNU/Linux"; | ||
homepage = https://openrazer.github.io/; | ||
license = stdenv.lib.licenses.gpl2; | ||
maintainers = [ stdenv.maintainers.roelvandijk ]; |
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 should be stdenv.lib.maintainers.roelvandijk
(note the evaluation error reported by ofborg). Better yet place a with stdenv.lib;
after the meta =
so that you don't need to repeat yourself.
let | ||
openrazerSrc = import ./src.nix; | ||
|
||
razermountPATH = stdenv.lib.makeBinPath [ coreutils ]; |
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 doesn't seem to be used.
sourceRoot = "source/daemon"; | ||
patches = [ | ||
# https://github.com/openrazer/openrazer/pull/681 | ||
./openrazer_python_daemon_script.patch |
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.
Instead of storing the patches in nixpkgs you might be able to refer to them using:
(fetchpatch {
url = https://github.com/openrazer/openrazer/commit/feefb86497af6ff7db827e682ae560c12d0aee2f.patch;
sha256 = "...";
})
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.
The patches from the pull requests are relative to the entire openrazer repository. The patches stored in nixpkgs are relative to the sourceRoot "source/daemon"
. We could of course take the patches from github and rewrite them to be relative to "daemon"
.
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.
You can use the stripLen
option of fetchpatch
to strip of the "daemon/" prefix like:
(fetchpatch {
url = https://github.com/openrazer/openrazer/commit/feefb86497af6ff7db827e682ae560c12d0aee2f.patch;
sha256 = "...";
stripLen = 1;
})
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.
Done
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.
Looks pretty good. I wrote some minor issues and recommendations inline.
18aaf42
to
2c79fde
Compare
Kernel drivers for talking to Razer products (keyboards, mice, etc.) Daemon for talking to the kernel drivers. Python library for talking to the daemon. Adds NixOS module hardware.openrazer which adds the kernel drivers and daemon to a system.
2c79fde
to
fa90486
Compare
@GrahamcOfBorg build linuxPackages.openrazer python3Packages.openrazer python3Packages.openrazer-daemon |
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: linuxPackages.openrazer, python3Packages.openrazer, python3Packages.openrazer-daemon Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: linuxPackages.openrazer, python3Packages.openrazer, python3Packages.openrazer-daemon Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: linuxPackages.openrazer, python3Packages.openrazer, python3Packages.openrazer-daemon Partial log (click to expand)
|
Note: there is a similar effort at https://github.com/lezed1/nixpkgs/commit/9b9cdf6d7e721657752b806e1e0df35bd2b02fd3 . It could be useful to compare both approaches. |
@roelvandijk the biggest differences between ours I found on my phone was manually setting up service files vs using the ones that come from the repo. I'll look at it closer tonight. |
@roelvandijk what about using @lezed1's trick of having a |
@@ -3545,6 +3545,9 @@ in { | |||
|
|||
odfpy = callPackage ../development/python-modules/odfpy { }; | |||
|
|||
openrazer = callPackage ../os-specific/linux/openrazer/pylib.nix { }; |
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.
The expressions need to move under pkgs/development/python-modules/*
.
Also, fix indentation.
What's the status on this? Is there anything I could do to help getting this merged? |
Also happy to help keep this one going. |
Fixed (per @FRidh) and rebased but I can't push 😕 |
@evanjs You wouldn't be able to push to LumiGuide's repo - my advice if @roelvandijk has gone radio silent on this (which considering the amount of time this PR has been active wouldn't surprise me) would be to create another PR with your changes and mention this PR number (#47009) in the new PR. If you don't want to do that though I'm happy to take over this one since I just got a new Razer laptop myself and really need this merged ASAP. |
Resolved with #64552 |
Thanks. |
Motivation for this change
I want to disable the annoying 'breath' effect of my Razer Blackwidow 2016 keyboard.
Things done
Enabled the NixOS module on my system. Tested with various Razer devices. Was able to successfully control the devices via the packaged python library.
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)cc @FRidh because of Python packages