diff --git a/srcpkgs/nitrokey-udev-rules/template b/srcpkgs/nitrokey-udev-rules/template new file mode 100644 index 00000000000..a9bbef6d56a --- /dev/null +++ b/srcpkgs/nitrokey-udev-rules/template @@ -0,0 +1,20 @@ +# Template file for 'nitrokey-udev-rules' +pkgname=nitrokey-udev-rules +version=1.0.0 +revision=1 +short_desc="Udev rules for Nitrokey devices" +maintainer="Mateusz Sylwestrzak " +license="CC0-1.0" +homepage="https://github.com/Nitrokey/nitrokey-udev-rules" +distfiles="https://github.com/Nitrokey/nitrokey-udev-rules/archive/refs/tags/v${version}.tar.gz" +checksum=604658f9d10c02b4ec4c299a103777efaa4b55ebf95f6deb2736461f7959ae9d + +post_patch() { + # allow non-elogind users to access Nitrokey devices + vsed -i 41-nitrokey.rules \ + -e '/TAG\s*+=\s*"uaccess"/s/$/, GROUP="plugdev"/' +} + +do_install() { + vinstall 41-nitrokey.rules 0644 usr/lib/udev/rules.d +}