diff mbox series

[bug#35346,2/2] gnu: Add pass-otp.

Message ID 427dea7c-7fd4-4214-9bdc-c344a070e81d@www.fastmail.com
State Superseded
Headers show
Series Add pass-otp | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Alex Griffin April 20, 2019, 5:55 p.m. UTC
* gnu/packages/password-utils.scm (pass-otp): New variable.

Comments

Christopher Baines April 21, 2019, 9:30 p.m. UTC | #1
Alex Griffin <a@ajgrf.com> writes:

> * gnu/packages/password-utils.scm (pass-otp): New variable.
>

...

> +(define-public pass-otp
> +  (package
> +    (name "pass-otp")
> +    (version "1.2.0")

...

> +    (native-search-paths
> +     (list (search-path-specification
> +            (variable "PASSWORD_STORE_SYSTEM_EXTENSION_DIR")
> +            (files '("lib/password-store/extensions")))))

Hi Alex,

These changes are looking good, one thing though, is that I think this
native-search-paths field should be defined for the password-store
package, as it's the one that uses the search path.

While it works having it defined for pass-otp, having it in the
password-store package will become relevant if there are more extensions
packaged for Guix, as then they'll be able to take advantage of this as
well.

Thanks,

Chris
diff mbox series

Patch

From a04e90f450213be4cfc106096f18195e2e2ab931 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 20 Apr 2019 11:59:35 -0500
Subject: [PATCH 2/2] gnu: Add pass-otp.

* gnu/packages/password-utils.scm (pass-otp): New variable.
---
 gnu/packages/password-utils.scm | 53 +++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index b23dbf1fbb..a3caec22d9 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -48,6 +48,7 @@ 
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
+  #:use-module (gnu packages authentication)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
@@ -74,6 +75,7 @@ 
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages suckless)
+  #:use-module (gnu packages tcl)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages version-control)
@@ -494,6 +496,57 @@  changes to your password database to a git repository that can be managed
 through the pass command.")
     (license license:gpl2+)))
 
+(define-public pass-otp
+  (package
+    (name "pass-otp")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://github.com/tadfisher/pass-otp/releases/"
+                       "download/v" version "/pass-otp-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0rrs3iazq80dn0wbl20xkh270428jd8l99m5gd7hl93s4r4sc82p"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:make-flags
+       (let* ((out      (assoc-ref %outputs "out"))
+              (bashcomp (string-append out "/etc/bash_completion.d")))
+         (list (string-append "PREFIX=" %output)
+               (string-append "BASHCOMPDIR=" bashcomp)))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'build 'patch-oath-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "otp.bash"
+               (("^OATH=.*$")
+                (string-append
+                 "OATH="
+                 (assoc-ref inputs "oath-toolkit")
+                 "/bin/oathtool\n")))
+             #t)))
+       #:test-target "test"))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "PASSWORD_STORE_SYSTEM_EXTENSION_DIR")
+            (files '("lib/password-store/extensions")))))
+    (inputs
+     `(("password-store" ,password-store)
+       ("expect" ,expect)
+       ("oath-toolkit" ,oath-toolkit)
+       ("git" ,git)
+       ("gnupg" ,gnupg)
+       ("which" ,which)))
+    (home-page "https://github.com/tadfisher/pass-otp")
+    (synopsis "Pass extension for managing one-time-password (OTP) tokens")
+    (description " An extension for password-store that allows adding
+one-time-password (OTP) secrets, generating OTP codes, and displaying secret
+key URIs using the standard otpauth:// scheme.")
+    (license license:gpl3+)))
+
 (define-public argon2
   (package
     (name "argon2")
-- 
2.20.1