1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-27 12:19:48 +01:00
home-manager/modules/services/taffybar.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2017-01-07 19:16:26 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.taffybar;
2020-02-02 00:39:17 +01:00
in {
meta.maintainers = [ maintainers.rycee ];
2017-01-07 19:16:26 +01:00
options = {
services.taffybar = {
enable = mkEnableOption "Taffybar";
package = mkOption {
default = pkgs.taffybar;
defaultText = literalExpression "pkgs.taffybar";
2017-01-07 19:16:26 +01:00
type = types.package;
example = literalExpression "pkgs.taffybar";
2017-01-07 19:16:26 +01:00
description = "The package to use for the Taffybar binary.";
};
};
};
config = mkIf config.services.taffybar.enable {
2022-04-24 16:25:54 +02:00
assertions = [
(hm.assertions.assertPlatform "services.taffybar" pkgs platforms.linux)
];
2017-01-07 19:16:26 +01:00
systemd.user.services.taffybar = {
2018-09-21 00:51:23 +02:00
Unit = {
Description = "Taffybar desktop bar";
PartOf = [ "tray.target" ];
StartLimitBurst = 5;
StartLimitIntervalSec = 10;
2018-09-21 00:51:23 +02:00
};
Service = {
Type = "dbus";
BusName = "org.taffybar.Bar";
2018-09-21 00:51:23 +02:00
ExecStart = "${cfg.package}/bin/taffybar";
Restart = "on-failure";
RestartSec = "2s";
2018-09-21 00:51:23 +02:00
};
Install = { WantedBy = [ "tray.target" ]; };
2017-01-07 19:16:26 +01:00
};
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
2017-01-07 19:16:26 +01:00
};
}