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
rivalcfg: init at 3.6.0 #66534
rivalcfg: init at 3.6.0 #66534
Conversation
pkgs/misc/rivalcfg/default.nix
Outdated
license = licenses.wtfpl; | ||
}; | ||
|
||
src = fetchurl { |
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 think using fetchFromGitHub is preferred
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.
correct, although it will resolve mostly to the same thing.
|
||
meta = with stdenv.lib; { | ||
description = "Small CLI utility program that allows you to configure SteelSeries Rival gaming mice"; | ||
license = licenses.wtfpl; |
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 should include a homepage (even if this is the same as the github url) and a maintainer
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.
Is the maintainer me? Should I add myself to the maintainers file?
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.
If you are happy to be the maintainer you should make a seperate commit adding yourself to the maintainers file
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.
maintainer is someone with some working knowledge of a package, and some amount of care
pkgs/misc/rivalcfg/default.nix
Outdated
pname = "rivalcfg"; | ||
version = "3.6.0"; | ||
|
||
meta = with stdenv.lib; { |
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.
meta usually goes at the bottom, though this is just a style thing
pkgs/misc/rivalcfg/default.nix
Outdated
@@ -0,0 +1,19 @@ | |||
{ stdenv, fetchurl, python3Packages }: |
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 could have lib instead of stdenv here
@@ -0,0 +1,19 @@ | |||
{ stdenv, fetchurl, python3Packages }: | |||
|
|||
with python3Packages; buildPythonPackage rec { |
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've never seen with python3Packages;
used before, do you have an example where this has been used somewhere
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.
Yes, in tools/text/invoice2data. I grepped for buildPythonPackage since I was getting an error and copied from that package. Should I be using python37Packages?
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 am not sure, I am not a python expert. My query was more about using with instead of python3Packages.buildPythonPackage
here and moving the with python3Packages
to the buildInputs. It can be confusing to have big with clauses, for example it is not obvious that the build inputs are coming form python3Packages
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.
python3Package, python37Packages, python3.pkgs are all aliases of each other.
nixos/modules/programs/rivalcfg.nix
Outdated
|
||
users.extraGroups.mouse.gid = config.ids.gids.mouse; | ||
services.udev.extraRules = '' | ||
# SteelSeries Rival |
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.
Where are you sourcing these rules from? It may be better to set up a derivation to fetch these
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.
Those rules are from a file in the project itself, modified so that it uses the mouse group instead of just chmodding the device nodes to 0666 because that seemed like a bad idea to me. I wasn't sure how to patch it and add it to the store though (it doesn't get installed by default), so I just hardcoded it.
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 could use substituteAll or a regular patch to patch it and you could maybe add to postInstall to manually install it?
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 try that.
pkgs/misc/rivalcfg/default.nix
Outdated
sha256 = "78bd2ed860ad62b5bcd2fba334d8b9fda04524f7d45dd4f57dc20d9b4124110b"; | ||
}; | ||
|
||
doCheck = 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.
do the tests not work?
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.
They don't, it won't install with them enabled.
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.
does it look fixable? it would be better to have the tests if they can be made to work
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.
Probably not by me, I looked into it a bit when it was failing and had no idea what it was doing.
maintainers/maintainer-list.nix
Outdated
@@ -3947,6 +3947,10 @@ | |||
github = "orivej"; | |||
name = "Orivej Desh"; | |||
}; | |||
ornxka = { | |||
email = "ornx@protonmail.com" |
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.
;
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.
your python package should look something like this:
with python3Packages; buildPythonPackage rec {
pname = "rivalcfg";
version = "3.6.0";
src = fetchFromGitHub {
owner = "flozz";
repo = "rivalcfg";
rev = "v${version}";
sha256 = "1xfaxc2qhbgi46m8ihhcgk9xfgkrvaqk0fhfav13378cihhdwwpn";
};
propagatedBuildInputs = [ hidapi ];
checkInputs = [ pytest ];
checkPhase = "pytest";
meta = with stdenv.lib; {
description = "Small CLI utility program that allows you to configure SteelSeries Rival gaming mice";
license = licenses.wtfpl;
};
}
Thank you all for your input on this pull request, it has been very helpful. I believe the latest version incorporates all of your feedback and I have tested it on my machine and it seems to work, including the tests. Please tell me if there are any further issues. |
I would also consolidate your commits as so:
I'm not super familiar with doing nixos modules, but seems more "correct" cc @infinisil for his nixos knowledge and a review :) |
I have consolidated the commits and fixed the commit messages. |
nixos/modules/misc/ids.nix
Outdated
@@ -640,6 +640,7 @@ | |||
cockroachdb = 313; | |||
zoneminder = 314; | |||
paperless = 315; | |||
mouse = 316; |
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.
Don't assign a static id, see #65698
Here you can just not assign one and NixOS will choose a group automatically
nixos/modules/programs/rivalcfg.nix
Outdated
}; | ||
|
||
users.extraGroups.mouse.gid = config.ids.gids.mouse; | ||
services.udev.extraRules = fileContents "${pkgs.rivalcfg}/share/rivalcfg/99-steelseries-rival.rules"; |
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 is no good, this requires IFD to evaluate, you should use udev.packages
or so instead
I dropped the module (I figure I can just use the "users" group instead of making a new group), and updated the package so it can be used with |
I don't think dropping the module is necessary, but instead include a simple module which adds the package to A bit like https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/light.nix |
Thank you for your contributions.
|
Motivation for this change
added the rivalcfg package for configuring steelseries mice
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @