From f091cd5e03b5abed95c68c80a4df8af2dbcabedc Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2023 13:17:30 +0200 Subject: brain: add bash-completion --- krebs/5pkgs/simple/brain/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/simple/brain/default.nix b/krebs/5pkgs/simple/brain/default.nix index 9b125862..bf52da75 100644 --- a/krebs/5pkgs/simple/brain/default.nix +++ b/krebs/5pkgs/simple/brain/default.nix @@ -1,4 +1,4 @@ -{ pass, write, writeDash, ... }: +{ pass, runCommand, write, writeDash, ... }: write "brain" { "/bin/brain".link = writeDash "brain" '' @@ -9,4 +9,14 @@ write "brain" { PASSWORD_STORE_DIR=$HOME/brain \ exec ${pass}/bin/passmenu $@ ''; + "/share/bash-completion/completions/brain".link = + runCommand "brain-completions" { + } /* sh */ '' + sed -r ' + s/\<_pass?(_|\>)/_brain\1/g + s/\<__password_store/_brain/g + s/\/brain/ + s/\$HOME\/\.password-store/$HOME\/brain/ + ' < ${pass}/share/bash-completion/completions/pass > $out + ''; } -- cgit v1.2.3