{
  config,
  lib,
  pkgs,
  ...
}: {
  imports = [../password-store];

  options.dotfiles.inputs.home-manager.programs.rofi = {
    enable = lib.dotfiles.mkEnableOption;
    pass.enable = lib.dotfiles.mkEnableOption;
  };

  config = let
    cfg = config.dotfiles.inputs.home-manager.programs.rofi;
  in
    lib.mkIf (cfg.enable || cfg.pass.enable) {
      dotfiles.inputs.home-manager.programs.password-store.enable = true;

      programs.rofi = {
        inherit (cfg) enable;

        package = pkgs.rofi-wayland;

        pass = {
          inherit (cfg.pass) enable;
          package = pkgs.rofi-pass-wayland;
        };

        theme = let
          padding = let
            padding = {
              element = 5;
              inputbar = padding.element * 2;
            };
          in {
            element = "${toString padding.element}px";
            inputbar = "${toString padding.inputbar}px";
          };
        in {
          element = {
            padding = padding.element;
            spacing = padding.element;
          };

          inputbar = {
            children = ["prompt" "entry"];
            padding = "${padding.inputbar} ${padding.inputbar}";
            spacing = padding.inputbar;
          };

          window.width = "25%";
        };
      };
    };
}
