mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
4f70f49cec
This target is for systemd units that require a system tray to be running. This also fixes taffybar.service: previously, systemd would consider it to be active (running) before it was actually ready to accept tray icons.
45 lines
995 B
Nix
45 lines
995 B
Nix
{ 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;
|
|
defaultText = literalExample "pkgs.taffybar";
|
|
type = types.package;
|
|
example = literalExample "pkgs.taffybar";
|
|
description = "The package to use for the Taffybar binary.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf config.services.taffybar.enable {
|
|
systemd.user.services.taffybar = {
|
|
Unit = {
|
|
Description = "Taffybar desktop bar";
|
|
PartOf = [ "tray.target" ];
|
|
};
|
|
|
|
Service = {
|
|
Type = "dbus";
|
|
BusName = "org.taffybar.Bar";
|
|
ExecStart = "${cfg.package}/bin/taffybar";
|
|
Restart = "on-failure";
|
|
};
|
|
|
|
Install = { WantedBy = [ "tray.target" ]; };
|
|
};
|
|
|
|
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
|
|
};
|
|
}
|