2.home-manager/modules/services/taffybar/default.nix
Austin Horstman 4fca600cb1 treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00

52 lines
1,008 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.taffybar;
in
{
meta.maintainers = [ lib.maintainers.rycee ];
options = {
services.taffybar = {
enable = lib.mkEnableOption "Taffybar";
package = lib.mkPackageOption pkgs "taffybar" { };
};
};
config = lib.mkIf config.services.taffybar.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.taffybar" pkgs lib.platforms.linux)
];
systemd.user.services.taffybar = {
Unit = {
Description = "Taffybar desktop bar";
PartOf = [ "tray.target" ];
StartLimitBurst = 5;
StartLimitIntervalSec = 10;
};
Service = {
Type = "dbus";
BusName = "org.taffybar.Bar";
ExecStart = "${cfg.package}/bin/taffybar";
Restart = "on-failure";
RestartSec = "2s";
};
Install = {
WantedBy = [ "tray.target" ];
};
};
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
};
}