aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/rofi/default.nix
blob: d193c10f2c5619361e5450fc4a19e4167770d74a (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
{
  config,
  lib,
  ...
}:
{
  options.desktop.rofi = {
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = config.programs.rofi.finalPackage;
      description = "The rofi package to use.";
    };
  };

  config = lib.mkIf config.desktop.enable {
    programs.rofi = {
      enable = true;
      theme =
        let
          template =
            builtins.replaceStrings
              [
                "@@rofi-font@@"
                "@@rofi-font-message@@"
              ]
              [
                ''"${config.fonts.normal} Bold ${toString config.fonts.size}"''
                ''"${config.fonts.normal} Bold ${toString config.fonts.idxSize}"''
              ]
              (builtins.readFile ./theme.mustache.rasi);
        in
        "${config.scheme {
          inherit template;
          extension = ".rasi";
        }}";
      extraConfig = {
        modi = "drun";
        show-icons = true;
        drun-display-format = "{name}";
        sort = true;
      };
    };
  };
}