From 2a03f28fc5c0fb7858bfe2c24b6c9cfb72ce9334 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Mon, 28 Oct 2024 09:16:15 +0700 Subject: [PATCH] hyprland: added bitwarden rofi support --- home/modules/hyprland/bitwarden.nix | 33 +++++++++++++++++++++++++++++ home/modules/hyprland/default.nix | 1 + secrets/bitwarden.yaml | 22 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 home/modules/hyprland/bitwarden.nix create mode 100644 secrets/bitwarden.yaml diff --git a/home/modules/hyprland/bitwarden.nix b/home/modules/hyprland/bitwarden.nix new file mode 100644 index 0000000..624f8b3 --- /dev/null +++ b/home/modules/hyprland/bitwarden.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.profile.hyprland; + inherit (lib) mkIf; +in +{ + config = mkIf cfg.enable { + home.packages = with pkgs; [ + rofi-wayland + rbw + rofi-rbw-wayland + ydotool + pinentry-tty + ]; + + sops = { + secrets."bitwarden/config.json" = { + sopsFile = ../../../secrets/bitwarden.yaml; + path = "${config.home.homeDirectory}/.config/rbw/config.json"; + }; + }; + + wayland.windowManager.hyprland.settings.bind = [ + # Needs to login first to bitwarden via `rbw login` command + "$mod, Z, exec, rofi-rbw" + ]; + }; +} diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 4b0b928..c7ffd18 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -10,6 +10,7 @@ in { imports = [ # ./dunst.nix + ./bitwarden.nix ./hypridle.nix ./hyprland.nix ./hyprlock.nix diff --git a/secrets/bitwarden.yaml b/secrets/bitwarden.yaml new file mode 100644 index 0000000..fd7429c --- /dev/null +++ b/secrets/bitwarden.yaml @@ -0,0 +1,22 @@ +bitwarden: + config.json: ENC[AES256_GCM,data:oob3Dybuex844TY57FmTL+JVgPS/QQeEVMVeiOYrGaXLpH0OE76rJMiOPw==,iv:aH6Xz+3bPRkK7Il8/g516du4IJ7k71hZMTlF33YARBQ=,tag:LOf9yZDkASMwAq3UvWjv2g==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1kruum2varzua7w5n6n52vhwyek2arc685rhcwt0u7k2jf5mecsjslkl9ll + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBDUXV1MlI2eGp5dm9NVkxX + cjc4azd3RUxZTzA4UjE2YVlCZFVFaWd6ajNvCk56RzdTVEYvMlkwUVkyM1Vmc3p5 + alZWbDdpLys2eHRzR2tmTEJ6c3hBcVkKLS0tIGlFdS9xZEdDSERVZ3YyN29GZi82 + NkhTR0pOd1JxNXhjb3hsWlFyREl5RU0KHFFdDs1BDo/CUeIjV7QGxIfL6nwfuzYE + +zRqZDbocFnNQ5m6X17O11+xGhRASL7ORweIeVlzCpCyJ27IsaoSIA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-10-28T02:13:49Z" + mac: ENC[AES256_GCM,data:52uwqIj5gXnXlFRuzd9mqvziAGkso+HWwqlD4EcOhXs11dHpgaWsusq27ItwyHwZaN8UUN8frfC9/U4JppOgjiUXpteO78DX/Hc8QZP9Q7Fw5rvd0jpQIWDhXC0LmqIIg0v3lvv1jgWkMHrxBsB5IfJiOlitwX9hG9wn+8H7Qq0=,iv:FvZmiqJmD5bJAM0PV6/uolsMn4r2UC964MUXL17K3o8=,tag:Dy9kVUhtbLrC5ykJsr1Mcg==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.8.1