1
0
Fork 0

Replace pass-clip with simple script

This commit is contained in:
Malte 2022-10-11 19:08:35 +02:00
parent 49d6ee9ad4
commit 59d58ae9e3
5 changed files with 36 additions and 26 deletions

View file

@ -63,7 +63,7 @@
'';
};
password-store = {
package = pkgs.pass-wayland.withExtensions (exts: [exts.pass-update pkgs.pass-clip exts.pass-otp]);
package = pkgs.pass-wayland.withExtensions (exts: [exts.pass-update exts.pass-otp]);
enable = true;
settings.PASSWORD_STORE_DIR = "${config.home.homeDirectory}/git/password-store";
};

View file

@ -21,6 +21,12 @@ in [
Edit = "codium ~/git/promotion";
};
}
{
Passmenu = {
Password = "pass-fzf";
OTP = "pass-fzf otp";
};
}
{
Power = {
Shutdown = "systemctl poweroff";
@ -88,7 +94,6 @@ in [
VoxMachina = "mpv https://www.youtube.com/playlist?list=PL1tiwbzkOjQz7D0l_eLJGAISVtcL7oRu_";
};
}
{Passmenu = "pass clip -f";}
{"Select Mode" = "select-mode";}
{
Communication = [

View file

@ -1,24 +0,0 @@
self: super: {
pass-clip =
self.callPackage
({
stdenv,
fetchFromGitHub,
pass-wayland,
}:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "pass-clip";
version = "0.3";
src = fetchFromGitHub {
owner = "ibizaman";
repo = "pass-clip";
rev = "v${version}";
sha256 = "0myyyw0azci95jp8lwh6bm7xi171fv9vg8j6lzf9m9n7282cmy33";
};
dontBuild = true;
installPhase = "PREFIX=$out make install";
propagatedBuildInputs = [pass-wayland];
})
{};
}

28
overlays/pass-fzf.sh Normal file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
## Adapted from https://gist.github.com/heywoodlh/4c1e27f477a896bc3b0f6d55e2748d26
## Assumes that the user is using otp plugin
## Install fzf and make sure pass is configured beforehand
## If you want to grab the otp code, use like so: `pass-fzf.sh otp`, otherwise script will assume you want password
cd ~/.password-store || exit
if [[ $1 == 'otp' ]]
then
type="otp"
else
type="password"
fi
selection="$(find -L . -name '*.gpg' | sed -e 's/.\///' -e 's/.gpg//' | fzf)"
if [ ${type} == "otp" ]
then
pass otp "${selection}" -c
else
pass "${selection}" -c
fi

View file

@ -158,6 +158,7 @@ self: super: {
gh
;
obelisk = (import self.sources.obelisk {}).command;
pass-fzf = self.writeShellScriptBin "pass-fzf" (builtins.readFile ./pass-fzf.sh);
};
accounting-pkgs = {
inherit (self.haskellPackages) hledger hledger-ui hledger-web;