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 {
|
2017-09-26 23:40:31 +02:00
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
options = {
|
|
|
|
services.taffybar = {
|
|
|
|
enable = mkEnableOption "Taffybar";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
default = pkgs.taffybar;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.taffybar";
|
2017-01-07 19:16:26 +01:00
|
|
|
type = types.package;
|
2021-10-09 11:14:08 +02:00
|
|
|
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";
|
2021-05-22 04:15:12 +02:00
|
|
|
PartOf = [ "tray.target" ];
|
2018-09-21 00:51:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2021-05-22 04:15:12 +02:00
|
|
|
Type = "dbus";
|
|
|
|
BusName = "org.taffybar.Bar";
|
2018-09-21 00:51:23 +02:00
|
|
|
ExecStart = "${cfg.package}/bin/taffybar";
|
2019-03-26 18:05:44 +01:00
|
|
|
Restart = "on-failure";
|
2018-09-21 00:51:23 +02:00
|
|
|
};
|
|
|
|
|
2021-05-22 04:15:12 +02:00
|
|
|
Install = { WantedBy = [ "tray.target" ]; };
|
2017-01-07 19:16:26 +01:00
|
|
|
};
|
2019-06-23 14:06:29 +02:00
|
|
|
|
|
|
|
xsession.importedVariables = [ "GDK_PIXBUF_MODULE_FILE" ];
|
2017-01-07 19:16:26 +01:00
|
|
|
};
|
|
|
|
}
|