-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Add udev rules for Ledger devices #39950
Conversation
</listitem> | ||
<listitem> | ||
<para> | ||
<literal>./services/hardware/ledger.nix</literal> |
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 this section is usually auto-generated before release.
|
||
installPhase = '' | ||
mkdir --parents "$out/lib/udev/rules.d" | ||
cat add_udev_rules.sh | grep echo | sed "s_/etc_$out/lib_" | sed "s_hw1_ledger_" | sed 's_MODE=\\"0660\\",__' | sed 's_GROUP=\\"plugdev\\"_TAG+=\\"uaccess\\"_' > install.sh |
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.
Could you maybe ask upstream to provide the rules in a separate 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.
I'll try.
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.
Submitted LedgerHQ/udev-rules#1 upstream.
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.
Could we just embed these rules? The other key modules does it as well.
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 did it this way because I was trying to follow the example of an existing package (libu2f-host), but I don't have an opinion. I'd be happy to amend the PR to embed the rules if that's preferable.
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 the script is preferable – since upstream does not provide the rules file, we would need to convert the add_udev_rules.sh
file with each update anyway.
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 doubt that script is likely to be stable enough for my sed
nonsense to remain reliable, so I think it's a wash.
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.
It got merged!
For some reason, trying out your rules on my NixOS doesn't work. It only works if I explicitly set Is there something that's meant to happen with |
Should we add |
I don't think so, I believe |
Possibly |
@CMCDragonkai's addition was necessary for this to work in my case too, and I use i3. @chris-martin maybe EDIT: The |
This adds udev rules for Ledget wallets, allowing you to use a Ledger device by adding
hardware.ledger.enable = true;
to your NixOS config.The source file is a bash script at https://github.com/LedgerHQ/udev-rules/blob/master/add_udev_rules.sh and I made the
ledger-udev-rule
package by applying some replacements withsed
. The rules file ends up looks like this:lib/udev/rules.d/20-ledger.rules