global pkgs
This commit is contained in:
1
custom-pkgs/otp/default.nix
Normal file
1
custom-pkgs/otp/default.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ util, ... }: util.package
|
||||
17
custom-pkgs/otp/package.nix
Normal file
17
custom-pkgs/otp/package.nix
Normal 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
|
||||
''
|
||||
Reference in New Issue
Block a user