-
-
Save cleverca22/12fbff67b2b43b880097736e0bf9756a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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