stockholm/krebs/5pkgs/simple/brain/default.nix

23 lines
653 B
Nix
Raw Normal View History

2023-08-01 11:17:30 +00:00
{ pass, runCommand, write, writeDash, ... }:
2017-06-18 14:06:37 +00:00
2018-06-19 19:23:35 +00:00
write "brain" {
2017-06-20 14:19:15 +00:00
"/bin/brain".link = writeDash "brain" ''
2017-06-18 14:06:37 +00:00
PASSWORD_STORE_DIR=$HOME/brain \
2024-06-25 09:30:15 +00:00
exec ${pass}/bin/pass "$@"
2017-06-18 14:06:37 +00:00
'';
2017-06-20 14:19:15 +00:00
"/bin/brainmenu".link = writeDash "brainmenu" ''
2017-06-18 14:06:37 +00:00
PASSWORD_STORE_DIR=$HOME/brain \
2024-06-25 09:30:15 +00:00
exec ${pass}/bin/passmenu "$@"
2017-06-18 14:06:37 +00:00
'';
2023-08-01 11:17:30 +00:00
"/share/bash-completion/completions/brain".link =
runCommand "brain-completions" {
} /* sh */ ''
sed -r '
s/\<_pass?(_|\>)/_brain\1/g
s/\<__password_store/_brain/g
s/\<pass\>/brain/
s/\$HOME\/\.password-store/$HOME\/brain/
' < ${pass}/share/bash-completion/completions/pass > $out
'';
2017-06-18 14:06:37 +00:00
}