2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.taffybar;
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.taffybar = {
|
|
|
|
enable = mkEnableOption "Taffybar";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
default = pkgs.taffybar;
|
2021-11-04 16:42:44 +00:00
|
|
|
defaultText = literalExpression "pkgs.taffybar";
|
2020-10-12 00:22:58 +00:00
|
|
|
type = types.package;
|
2021-11-04 16:42:44 +00:00
|
|
|
example = literalExpression "pkgs.taffybar";
|
2020-10-12 00:22:58 +00:00
|
|
|
description = "The package to use for the Taffybar binary.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.services.taffybar.enable {
|
|
|
|
systemd.user.services.taffybar = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Taffybar desktop bar";
|
2021-07-02 22:36:30 +00:00
|
|
|
PartOf = [ "tray.target" ];
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2021-07-02 22:36:30 +00:00
|
|
|
Type = "dbus";
|
|
|
|
BusName = "org.taffybar.Bar";
|
2020-10-12 00:22:58 +00:00
|
|
|
ExecStart = "${cfg.package}/bin/taffybar";
|
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
Install = { WantedBy = [ "tray.target" ]; };
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
|
|
|
|
};
|
|
|
|
}
|