diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index a6af01d..fabf562 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -78,6 +78,7 @@ # tools tools.gpg.enable = true; tools.mpv.enable = true; + tools.rbw.enable = true; }; }; diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 30472ed..9e73b83 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -97,6 +97,9 @@ in { ;; esac ''; + grabPasswordScript = pkgs.writeScript "grab-password" '' + ${lib.getExe pkgs.rbw} get $(${lib.getExe pkgs.gnome.zenity} --entry --text="Enter the name for your password entry to copy it to your clipboard" --title="Password") | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard + ''; in [ "$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run" ", print, exec, ${screenshotScript}" @@ -121,6 +124,7 @@ in { "$mod, bracketright, workspace, e+1" ", XF86LaunchA, exec, ${screenshotScript}" + ", XF86LaunchB, exec, ${grabPasswordScript}" ] ++ ( # workspaces # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} diff --git a/modules/software/tools/rbw.nix b/modules/software/tools/rbw.nix new file mode 100644 index 0000000..00d78cd --- /dev/null +++ b/modules/software/tools/rbw.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.software.tools.rbw; +in { + options.modules.software.tools.rbw = { + enable = mkEnableOption "Enable rbw, a CLI Bitwarden frontend"; + }; + + config = mkIf cfg.enable { + hm.programs.rbw = { + enable = true; + settings.email = "reidlab325@gmail.com"; + settings.lock_timeout = 60 * 60 * 24 * 7; # 1 week + settings.pinentry = pkgs.pinentry-gnome3; + }; + }; +} \ No newline at end of file diff --git a/overlays/.gitkeep b/overlays/.gitkeep deleted file mode 100755 index e69de29..0000000 diff --git a/overlays/rbw.nix b/overlays/rbw.nix new file mode 100644 index 0000000..f5d8ba3 --- /dev/null +++ b/overlays/rbw.nix @@ -0,0 +1,20 @@ +final: prev: { + rbw = prev.rbw.overrideAttrs (old: rec { + version = "1.11.0"; + + src = prev.fetchzip { + url = "https://git.tozt.net/rbw/snapshot/rbw-${version}.tar.gz"; + hash = "sha256-5KZ6mYYJEqsqREhQ/DoEgvPSwagObBCx8SFsiIiWCsI="; + }; + + # we can't just override `cargoHash`, because of Nix + # https://github.com/NixOS/nixpkgs/issues/107070 + cargoDeps = old.cargoDeps.overrideAttrs ( + prev.lib.const { + name = "${old.pname}-vendor.tar.gz"; + inherit src; + outputHash = "sha256-KlN31eNwywNVqwCl8s9r2RvEYl9/UMR2DR6Ov4ffwoc="; + } + ); + }); +} \ No newline at end of file