From patchwork Fri Jan 14 21:15:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Kehayias X-Patchwork-Id: 36347 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4DD1A27BBEA; Fri, 14 Jan 2022 21:16:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BF3FD27BBE9 for ; Fri, 14 Jan 2022 21:16:17 +0000 (GMT) Received: from localhost ([::1]:48200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8Tvk-00069G-VB for patchwork@mira.cbaines.net; Fri, 14 Jan 2022 16:16:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8TvX-000697-5H for guix-patches@gnu.org; Fri, 14 Jan 2022 16:16:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8TvW-0002Eb-Ro for guix-patches@gnu.org; Fri, 14 Jan 2022 16:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8TvW-0005hG-Kk for guix-patches@gnu.org; Fri, 14 Jan 2022 16:16:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53270] [PATCH] gnu: Add yubikey-oath-dmenu. Resent-From: John Kehayias Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 14 Jan 2022 21:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53270 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53270@debbugs.gnu.org X-Debbugs-Original-To: Guix-patches Received: via spool by submit@debbugs.gnu.org id=B.164219493621848 (code B ref -1); Fri, 14 Jan 2022 21:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2022 21:15:36 +0000 Received: from localhost ([127.0.0.1]:38387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8Tv2-0005gD-Cu for submit@debbugs.gnu.org; Fri, 14 Jan 2022 16:15:36 -0500 Received: from lists.gnu.org ([209.51.188.17]:49780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8Tuy-0005g3-AK for submit@debbugs.gnu.org; Fri, 14 Jan 2022 16:15:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Tux-000602-H4 for guix-patches@gnu.org; Fri, 14 Jan 2022 16:15:27 -0500 Received: from mail-4316.protonmail.ch ([185.70.43.16]:63125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Tuu-00026K-Ne for guix-patches@gnu.org; Fri, 14 Jan 2022 16:15:27 -0500 Date: Fri, 14 Jan 2022 21:15:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1642194912; bh=q+UFSpDhsIlYRph9If4opORmLO+D6ZEfDvhulMyB9Rc=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc; b=LSguG/XbiKT1hHe6qBBa02kjBFWczbxUnJx57le04NwgsCXnerj948bGIVdTnnA/W 39fyxpTm5F8ZdpE5SzMPIi90njyYQvb4+A+OXYU4BFE6KBwV9uPtrlhhl1vdBgo7w8 97v8SAAhrFvITrnU0Bupke1qi9Gq3fLQTRrgC6DDhnb2CsNUHhWQxvZB8T3k4g/q7U FJozRLvClMPFmScFNiOfGAGxMw4IXpvxiNEL6DYlospIRQNXnMbZQPCpl60cf/G4ga 6Bjf/KE5nwS9e7tb6G+ZmvXfTIBAqukoY119efjCLTKrwxVRIZ6z46ar/9h4AGWtO/ w0xrQma+PaLMw== Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.16; envelope-from=john.kehayias@protonmail.com; helo=mail-4316.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: John Kehayias X-ACL-Warn: , John Kehayias via Guix-patches X-Patchwork-Original-From: John Kehayias via Guix-patches via From: John Kehayias X-getmail-retrieved-from-mailbox: Patches Hello! Here is a patch to add yubikey-oath-dmenu, a handy way to get OATH codes from a Yubikey with a dmenu interface. I use it all the time (though through rofi). It seemed the best place was in the security-token module with similar yubikey packages. This is written in python but meant to run as a program rather than used as a library, so I called it without a python- prefix (and it runs with just non-propagated inputs). Thanks! John From dae602f6db781ec71ab79a560b522270f35750cd Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Fri, 14 Jan 2022 16:11:47 -0500 Subject: [PATCH] gnu: Add yubikey-oath-dmenu. * gnu/packages/security-token.scm (yubikey-oath-dmenu): New variable. --- gnu/packages/security-token.scm | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm index 79afdcee47..3a2d88cf8d 100644 --- a/gnu/packages/security-token.scm +++ b/gnu/packages/security-token.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2021 Sergey Trofimov ;;; Copyright © 2021 Dhruvin Gandhi ;;; Copyright © 2021 Ahmad Jarara +;;; Copyright © 2022 John Kehayias ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,6 +54,7 @@ (define-module (gnu packages security-token) #:use-module (gnu packages dns) #:use-module (gnu packages gettext) #:use-module (gnu packages graphviz) + #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) #:use-module (gnu packages gtk) #:use-module (gnu packages libbsd) @@ -72,7 +74,9 @@ (define-module (gnu packages security-token) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-xyz) #:use-module (gnu packages swig) + #:use-module (gnu packages suckless) #:use-module (gnu packages web) + #:use-module (gnu packages xdisorg) #:use-module (gnu packages xml)) (define-public ccid @@ -443,6 +447,65 @@ (define-public python-pyscard (define-public python2-pyscard (package-with-python2 python-pyscard)) +(define-public yubikey-oath-dmenu + (package + (name "yubikey-oath-dmenu") + (version "0.13.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/emlun/yubikey-oath-dmenu") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1h6dr4l0gzgdg8zn2c39kx9cx1bgvwqxkz3z95qz9r70xfsghgwk")))) + (build-system python-build-system) + (arguments + (list + #:tests? #f ; there are no tests + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ; no configure script + (delete 'build) ; or build + (add-after 'unpack 'fix-paths + (lambda _ + (for-each (lambda (tool) + (substitute* "yubikey-oath-dmenu.py" + (((string-append "'" tool)) + (string-append "'" (which tool))))) + (list "dmenu" "notify-send" "wl-copy" "xclip" "xdotool")))) + (replace 'install + (lambda _ + (invoke "make" "install" + (string-append "DESTDIR=" #$output) + "PREFIX=")))))) + (inputs + (list dmenu + libnotify + python-click + python-yubikey-manager + ;; TODO add wtype, once packaged, for type support for Wayland + wl-clipboard ; optional clipboard support for Wayland + xclip ; optional clipboard support for X11 + xdotool)) ; optional type support for X11 + (home-page + "https://github.com/emlun/yubikey-oath-dmenu/") + (synopsis "Interface for getting OATH codes from a YubiKey using dmenu") + (description + "Yubikey-oath-demenu lets you pick an OATH credential from your YubiKey using +dmenu, and copies the corresponding OTP to the clipboard. Alternatively, it +can \"type\" the OTP using @code{xdotool} on X11. + +Notable features: + +@itemize +@item Pick between all credentials on all connected YubiKeys +@item No mouse interaction required +@end itemize\n") + (license license:gpl3+))) + (define-public libu2f-host (package (name "libu2f-host") -- 2.34.0