aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/rofi/default.nix
blob: 797cbe951af0236cb91dfc535fa6e3d757fc56fd (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
{
  config,
  lib,
  ...
}:
{
  options.desktop.rofi = {
    enable = lib.mkEnableOption "Enables rofi launcher." // {
      default = true;
    };
    package = lib.mkOption {
      type = lib.types.package;
      description = "The rofi package to use.";
    };
  };

  config = lib.mkIf config.desktop.enable {
    desktop.rofi.package = lib.mkDefault config.programs.rofi.finalPackage;

    programs.rofi = {
      enable = config.desktop.rofi.enable;
      theme = "${config.scheme {
        template = builtins.readFile ./theme.mustache.rasi;
        extension = ".rasi";
      }}";
      extraConfig = {
        modi = "drun";
        show-icons = true;
        drun-display-format = "{name}";
        display-drun = "Launch";
        sort = true;
      };
    };
  };
}