aboutsummaryrefslogtreecommitdiff
path: root/modules/homeModules/rofi.nix
blob: 735dc773b8dde4c2f43811db71991040fcedaa2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{inputs, ...}: {
  flake.homeModules.rofi = {
    pkgs,
    config,
    lib,
    ...
  }: {
    options.customs = {
      rofi.enable = lib.mkEnableOption "enable rofi";
      rofi.package = lib.mkPackageOption pkgs "rofi package" {default = ["rofi"];};
    };

    config = lib.mkIf config.customs.rofi.enable {
      programs.rofi = {
        enable = true;
        package = config.customs.rofi.package;
        theme = with config.lib.stylix.colors.withHashtag;
          builtins.toFile "theme.rasi" ''
            * {
                font:   "FiraCode Nerd Font Medium 12";

                bg0:     ${base01};
                bg1:     ${base02};
                fg0:     ${base04};

                accent-color:     ${base03};
                urgent-color:     #ffffff;

                background-color:   transparent;
                text-color:         @fg0;

                margin:     0;
                padding:    0;
                spacing:    0;
            }

            ${builtins.readFile ./attachments/rofi-theme.rasi}'';
        cycle = true;
        plugins = with pkgs; [
          rofi-emoji
          rofi-calc
        ];
        extraConfig = {
          kb-row-up = "Up,Ctrl+p";
          kb-row-down = "Down,Ctrl+n";
        };
      };
    };
  };
}