synix/modules/home/rofi-rbw/default.nix
sid 95a533c876
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s
initial commit
2026-02-23 20:34:35 +01:00

55 lines
1 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.rofi-rbw;
inherit (lib)
generators
mkEnableOption
mkIf
mkOption
mkPackageOption
types
;
in
{
options = {
programs.rofi-rbw = {
enable = mkEnableOption "rofi-rbw";
package = mkPackageOption pkgs "rofi-rbw" { };
settings = mkOption {
type = types.attrsOf (
types.oneOf [
types.str
types.int
types.bool
]
);
default = { };
example = {
action = "copy";
prompt = "Bitwarden";
selector = "rofi";
selector-args = "-i";
};
description = ''
Configuration settings for rofi-rbw.
See https://github.com/fdw/rofi-rbw/blob/main/docs/rofi-rbw.1.md
'';
};
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."rofi-rbw.rc".text = generators.toKeyValue {
mkKeyValue = key: value: "${key} = ${toString value}";
} cfg.settings;
};
}