global pkgs

This commit is contained in:
Joakim Repomaa
2025-01-30 19:33:33 +02:00
parent 6b8c9d6abf
commit ea7c4cbf31
19 changed files with 13 additions and 6 deletions

View File

@@ -0,0 +1,17 @@
{ pkgs }:
let
ykman = "${pkgs.yubikey-manager}/bin/ykman";
sk = "${pkgs.skim}/bin/sk";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
in
pkgs.writeShellScriptBin "otp" ''
skim_command=("${sk}")
if [ -n "$*" ]; then
skim_command+=(-q "$*")
fi
account=$(${ykman} oath accounts list | "''${skim_command[@]}")
[ -z "$account" ] && exit 1
${ykman} oath accounts code -s "$account" | ${wl-copy} -n
''