1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-02 04:53:33 +02:00
home-manager/modules/services/taffybar.nix
Naïm Favier bd11e2c5e6
Replace usage of literalExample
Instead use the new function `literalExpression`. See

  https://github.com/NixOS/nixpkgs/pull/136909
2021-10-13 00:16:10 +02:00

46 lines
1001 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 = literalExpression "pkgs.taffybar";
type = types.package;
example = literalExpression "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" ];
};
}