Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created February 26, 2018 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleverca22/12fbff67b2b43b880097736e0bf9756a to your computer and use it in GitHub Desktop.
Save cleverca22/12fbff67b2b43b880097736e0bf9756a to your computer and use it in GitHub Desktop.
{ lib, pkgs, ... }:
let
rofi-pass = pkgs.writeScriptBin "rofi-pass" ''
#!/bin/sh
export PATH=${lib.makeBinPath [ bashInteractive rofi pass xclip ]}
shopt -s nullglob globstar
password_files=(~/.data/pass/**/*.gpg)
password_files=("''${password_files[@]##*/.data/pass/}")
password_files=("''${password_files[@]%.gpg}")
password=$(printf '%s\n' "''${password_files[@]}" | rofi -dmenu -p "Search password: " "$@")
env > /tmp/vars
echo $XDG_DATA_HOME
PASSWORD_STORE_DIR=$XDG_DATA_HOME/pass PASSWORD_STORE_X_SELECTION=clipboard pass -c "$password"
'';
in {
environment.systemPackages = [ rofi-pass ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment