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

  config = lib.mkIf config.desktop.enable {
    programs.waybar = {
      enable = true;
      systemd.enable = true;

      settings = lib.mkMerge [
        (import ./bar { inherit config; })
        (import ./module { inherit config lib pkgs; })
      ];

      style = builtins.readFile (
        config.scheme {
          template = builtins.readFile ./style.mustache.css;
          extension = ".css";
        }
      );
    };
  };
}