rbw pinentry mocker, fixes

This commit is contained in:
Jill 2024-01-07 19:22:42 +03:00
parent fa9ee7a9c1
commit fde702526c
3 changed files with 36 additions and 6 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ pkgs, config, lib, ... }:
{
programs.vscode = {
enable = true;
@ -19,17 +19,17 @@
mutableExtensionsDir = false;
enableExtensionUpdateCheck = false;
enableUpdateCheck = false;
userSettings = with config.opinions.font; {
userSettings = with config.opinions.fonts; {
"telemetry.enableTelemetry" = false;
"editor.tabSize" = 2;
"editor.cursorSmoothCaretAnimation" = "on";
"editor.fontFamily" = "'${monospace.family}', monospace";
"editor.fontSize" = monospace.size;
"editor.fontSize" = monospace.size + 3; # no clue why i have to do this
"terminal.integrated.fontFamily" = "\"${monospace.family}\"";
"terminal.integrated.fontSize" = monospace.size;
"terminal.integrated.fontSize" = monospace.size + 3;
"window.dialogStyle" = "custom";
"window.titleBarStyle" = "custom";

View File

@ -139,10 +139,40 @@
# usually you don't need to do this, but this is a workaround for https://github.com/flameshot-org/flameshot/issues/3328
services.flameshot.enable = true;
programs.rbw = {
programs.rbw = let
passwordPath = "/home/oatmealine/sync/secrets/bitwardenpass-raw";
# thank you, random site i found with google
# https://fossies.org/linux/gnupg/tests/fake-pinentries/fake-pinentry.sh
getPassword = pkgs.writeShellScriptBin "get-bw-password" ''
echo "OK ready"
while read cmd rest; do
cmd=$(printf "%s" "$cmd" | tr 'A-Z' 'a-z')
if [ -z "$cmd" ]; then
continue;
fi
case "$cmd" in
\#*)
;;
getpin)
echo "D $(cat ${passwordPath})"
echo "OK"
;;
bye)
echo "OK"
exit 0
;;
*)
echo "OK"
;;
esac
done
'';
in {
enable = true;
settings.base_url = "https://bitwarden.lavatech.top";
settings.email = "oatmealine@disroot.org";
settings.lock_timeout = 60 * 60 * 24 * 7; # 1 week
settings.pinentry = getPassword.overrideAttrs (old: { binaryPath = "bin/get-bw-password"; });
};
# This value determines the home Manager release that your

View File

@ -10,7 +10,7 @@ in {
};
config = mkIf cfg.enable {
programs.micro.colorScheme = name;
programs.micro.settings.colorScheme = name;
home.file.".config/micro/colorschemes/${name}.micro".text = with config.colorScheme.colors; ''
color-link default "#${base05},#${base00}"
color-link comment "#${base03},#${base00}"