summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs/otpmenu
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-10-14 16:20:35 +0200
committerlassulus <lassulus@lassul.us>2019-10-14 16:20:35 +0200
commit5c8a21d37786f4974ca7793beda589eb6d6f7923 (patch)
treeb224866e022c9fb0975ea09acd24b252b0d7109d /lass/5pkgs/otpmenu
parent29c1679d74a516136f07ec06113b24174b911be5 (diff)
l: add pkgs.otpmenu
Diffstat (limited to 'lass/5pkgs/otpmenu')
-rw-r--r--lass/5pkgs/otpmenu/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/lass/5pkgs/otpmenu/default.nix b/lass/5pkgs/otpmenu/default.nix
new file mode 100644
index 000000000..fe6d5b94c
--- /dev/null
+++ b/lass/5pkgs/otpmenu/default.nix
@@ -0,0 +1,10 @@
+{ pkgs }:
+pkgs.writeDashBin "otpmenu" ''
+x=$(${pkgs.pass}/bin/pass git ls-files '*/otp.gpg' \
+ | ${pkgs.gnused}/bin/sed 's:/otp\.gpg$::' \
+ | ${pkgs.dmenu}/bin/dmenu
+)
+
+otp=$(${(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))}/bin/pass otp code "$x/otp")
+printf %s "$otp" | ${pkgs.xdotool}/bin/xdotool type -f -
+''