1{
2 lib,
3 pkgs,
4 config,
5 ...
6}:
7
8let
9 cfg = config.programs.waybar;
10in
11{
12 options.programs.waybar = {
13 enable = lib.mkEnableOption "waybar, a highly customizable Wayland bar for Sway and Wlroots based compositors";
14 package =
15 lib.mkPackageOption pkgs "waybar" { }
16 // lib.mkOption {
17 apply = pkg: pkg.override { systemdSupport = true; };
18 };
19 systemd.target = lib.mkOption {
20 type = lib.types.str;
21 description = ''
22 The systemd target that will automatically start the Waybar service.
23 '';
24 default = "graphical-session.target";
25 };
26 };
27
28 config = lib.mkIf cfg.enable {
29 environment.systemPackages = [ cfg.package ];
30 systemd = {
31 packages = [ cfg.package ];
32 user.services.waybar.wantedBy = [ cfg.systemd.target ];
33 };
34 };
35
36 meta.maintainers = [ lib.maintainers.FlorianFranzen ];
37}