all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding NitoKey Rules to U-Dev Rules
@ 2019-07-05 19:56 Raghav Gururajan
  2019-07-06  1:16 ` Mike Gerwitz
  0 siblings, 1 reply; 5+ messages in thread
From: Raghav Gururajan @ 2019-07-05 19:56 UTC (permalink / raw)
  To: help-guix

Hello Guix!

I have NitroKey (https://nitrokey.com). To make it work, it appears
nitrokey rules (https://raw.githubusercontent.com/Nitrokey/libnitrokey/
master/data/41-nitrokey.rules) has to be added to udev rules
(/etc/udev/rules.d/). Not sure how to do this in guix way. Any ideas?

Thank you!

Regards,
RG.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding NitoKey Rules to U-Dev Rules
  2019-07-05 19:56 Adding NitoKey Rules to U-Dev Rules Raghav Gururajan
@ 2019-07-06  1:16 ` Mike Gerwitz
  2019-07-06  8:42   ` Pierre Neidhardt
  2019-07-06 21:04   ` Raghav Gururajan
  0 siblings, 2 replies; 5+ messages in thread
From: Mike Gerwitz @ 2019-07-06  1:16 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

On Fri, Jul 05, 2019 at 15:56:26 -0400, Raghav Gururajan wrote:
> I have NitroKey (https://nitrokey.com). To make it work, it appears
> nitrokey rules (https://raw.githubusercontent.com/Nitrokey/libnitrokey/
> master/data/41-nitrokey.rules) has to be added to udev rules
> (/etc/udev/rules.d/). Not sure how to do this in guix way. Any ideas?

Is it not working for you today?

I have a Nitrokey Pro that I purchased at least a couple years back that
I use every day on a Guix system, including to sign this email.  Here's
my dmesg output:

--8<---------------cut here---------------start------------->8---
[12763.938755] usb 6-2: new full-speed USB device number 9 using uhci_hcd
[12764.125823] usb 6-2: New USB device found, idVendor=20a0, idProduct=4108, bcdDevice= 1.00
[12764.125827] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12764.125830] usb 6-2: Product: Nitrokey Pro
[12764.125832] usb 6-2: Manufacturer: Nitrokey
[12764.125835] usb 6-2: SerialNumber: XXXXXXXXXXXXXXXXXXXXXXXX
[12764.134361] input: Nitrokey Nitrokey Pro as /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0/0003:20A0:4108.0008/input/input20
[12764.191376] hid-generic 0003:20A0:4108.0008: input,hidraw0: USB HID v1.10 Keyboard [Nitrokey Nitrokey Pro] on usb-0000:00:1d.0-2/input0
--8<---------------cut here---------------end--------------->8---

Maybe there's trouble with newer versions or different types of keys,
though.

With regards to udev rules---I haven't done so myself, but see
`udev-rule' in the Guix manual under `Base Services'.

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
https://mikegerwitz.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding NitoKey Rules to U-Dev Rules
  2019-07-06  1:16 ` Mike Gerwitz
@ 2019-07-06  8:42   ` Pierre Neidhardt
  2019-07-06 21:01     ` Raghav Gururajan
  2019-07-06 21:04   ` Raghav Gururajan
  1 sibling, 1 reply; 5+ messages in thread
From: Pierre Neidhardt @ 2019-07-06  8:42 UTC (permalink / raw)
  To: Mike Gerwitz, Raghav Gururajan; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

I bought 1 year ago and did not succeed in getting it to work on Guix.
Haven't tried in a while though.

Regarding the Udev rule: in your operating system declaration, you can
try one of those 2 rules:


--8<---------------cut here---------------start------------->8---
(define %nitrokey-udev-rule
  (udev-rule
   "41-nitrokey.rules"
   (string-append "ACTION==\"add\", SUBSYSTEM==\"usb\", "
                  "ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4211\", "
                  "ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", GROUP+=\"users\", MODE=\"0666\"")))

; or

(define %nitrokey-udev-rule
  (file->udev-rule
   "41-nitrokey.rules"
   (let ((version "20170910"))
     (origin
       (method url-fetch)
       (uri "https://www.nitrokey.com/sites/default/files/41-nitrokey.rules")
       (sha256
        (base32 "127nghkfd4dl5mkf5xl1mij2ylxhkgg08nlh912xwrrjyjv4y9sa"))))))
--8<---------------cut here---------------end--------------->8---

Then modify the udev-service-type:

--8<---------------cut here---------------start------------->8---
(modify-services
      %desktop-services
    (udev-service-type config =>
                       (udev-configuration
                        (inherit config)
                        (rules (append (udev-configuration-rules config)
                                       (list %nitrokey-udev-rule))))))
--8<---------------cut here---------------end--------------->8---

For me, it seemed that the Udev rules worked, but after that any attempt
to use the key with GPG would segfault `gpg`! :(

Hopefully this has been fixed upstream.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding NitoKey Rules to U-Dev Rules
  2019-07-06  8:42   ` Pierre Neidhardt
@ 2019-07-06 21:01     ` Raghav Gururajan
  0 siblings, 0 replies; 5+ messages in thread
From: Raghav Gururajan @ 2019-07-06 21:01 UTC (permalink / raw)
  To: Pierre Neidhardt, Mike Gerwitz; +Cc: help-guix


> Regarding the Udev rule: in your operating system declaration, you
> can
> try one of those 2 rules:

Thank you very much for your effort in explaining the following. Much
appreciated ☺

> 
> --8<---------------cut here---------------start------------->8---
> (define %nitrokey-udev-rule
>   (udev-rule
>    "41-nitrokey.rules"
>    (string-append "ACTION==\"add\", SUBSYSTEM==\"usb\", "
>                   "ATTR{idVendor}==\"20a0\",
> ATTR{idProduct}==\"4211\", "
>                   "ENV{ID_SMARTCARD_READER}=\"1\",
> ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", GROUP+=\"users\",
> MODE=\"0666\"")))
> 

Hmm. The other one (below) seems straight forward and simpler. 😉 Thank
s though. :)

> 
> (define %nitrokey-udev-rule
>   (file->udev-rule
>    "41-nitrokey.rules"
>    (let ((version "20170910"))
>      (origin
>        (method url-fetch)
>        (uri "https://www.nitrokey.com/sites/default/files/41-nitrokey
> .rules")
>        (sha256
>         (base32
> "127nghkfd4dl5mkf5xl1mij2ylxhkgg08nlh912xwrrjyjv4y9sa"))))))

Thanks a lot again! Would you be able to add this definition
(%nitrokey-udev-rule) into master udev definitions in guix? So that any
user who wants to use these rules now or in future, can just modify
%desktop-services and append %nitrokey-udev-rule, as you suggested
below. ☺

> --8<---------------cut here---------------end--------------->8---
> 
> Then modify the udev-service-type:
> 
> --8<---------------cut here---------------start------------->8---
> (modify-services
>       %desktop-services
>     (udev-service-type config =>
>                        (udev-configuration
>                         (inherit config)
>                         (rules (append (udev-configuration-rules
> config)
>                                        (list %nitrokey-udev-
> rule))))))
> --8<---------------cut here---------------end--------------->8---

Gonna try ☺

> For me, it seemed that the Udev rules worked, but after that any
> attempt
> to use the key with GPG would segfault `gpg`! :(
> 
> Hopefully this has been fixed upstream.

Ah I see. 😕

Regards,
RG.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding NitoKey Rules to U-Dev Rules
  2019-07-06  1:16 ` Mike Gerwitz
  2019-07-06  8:42   ` Pierre Neidhardt
@ 2019-07-06 21:04   ` Raghav Gururajan
  1 sibling, 0 replies; 5+ messages in thread
From: Raghav Gururajan @ 2019-07-06 21:04 UTC (permalink / raw)
  To: Mike Gerwitz; +Cc: help-guix


> 
> Is it not working for you today?
> 

Nope 😕

> I have a Nitrokey Pro that I purchased at least a couple years back
> that
> I use every day on a Guix system, including to sign this
> email.  Here's
> my dmesg output:
> 
> --8<---------------cut here---------------start------------->8---
> [12763.938755] usb 6-2: new full-speed USB device number 9 using
> uhci_hcd
> [12764.125823] usb 6-2: New USB device found, idVendor=20a0,
> idProduct=4108, bcdDevice= 1.00
> [12764.125827] usb 6-2: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [12764.125830] usb 6-2: Product: Nitrokey Pro
> [12764.125832] usb 6-2: Manufacturer: Nitrokey
> [12764.125835] usb 6-2: SerialNumber: XXXXXXXXXXXXXXXXXXXXXXXX
> [12764.134361] input: Nitrokey Nitrokey Pro as
> /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-
> 2:1.0/0003:20A0:4108.0008/input/input20
> [12764.191376] hid-generic 0003:20A0:4108.0008: input,hidraw0: USB
> HID v1.10 Keyboard [Nitrokey Nitrokey Pro] on usb-0000:00:1d.0-
> 2/input0
> --8<---------------cut here---------------end--------------->8---
> 

Hmm, Interesting. Thanks for sharing this.

> Maybe there's trouble with newer versions or different types of keys,
> though.

You may be right. 

> With regards to udev rules---I haven't done so myself, but see
> `udev-rule' in the Guix manual under `Base Services'.

Thanks!

Regards,
RG.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-06 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-05 19:56 Adding NitoKey Rules to U-Dev Rules Raghav Gururajan
2019-07-06  1:16 ` Mike Gerwitz
2019-07-06  8:42   ` Pierre Neidhardt
2019-07-06 21:01     ` Raghav Gururajan
2019-07-06 21:04   ` Raghav Gururajan

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.