(desktop) Gen 473: Broke desktop default.nix down into modules, removed conditionals from users.nix, moved host-dependent logic into corresponding host folders, enabled keyd on laptop

This commit is contained in:
pagedMov
2024-10-14 02:54:34 -04:00
parent 395fa72cbf
commit 6dbe561378
10 changed files with 68 additions and 64 deletions

View File

@@ -3,9 +3,17 @@
pkgs.writeShellScriptBin "passhelper" (''
#!/run/current-system/sw/bin/bash
pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | rg -v ".gpg-id$" | fzf)
# prevent multiple instances, conditional check happens in the hyprland bind
touch /tmp/passhelperfile
trap "[ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile" EXIT SIGHUP SIGINT
# get passwords from password store, remove .password store/ prefix and .gpg suffix, exlude .gpg-id file, open results in fzf
pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | rg -v ".gpg-id$" | fzf --border --border-label="$(whoami)'s keyring")
[ $? = 0 ] || { [ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile; exit 1; }
pass -c "$pass_string"
sleep 1.5
/run/current-system/sw/bin/rm /tmp/passhelperfile
exit 0
'')