2018-07-19 23:29:47 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.status-notifier-watcher;
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2018-07-19 23:29:47 +02:00
|
|
|
meta.maintainers = [ maintainers.pltanton ];
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.status-notifier-watcher = {
|
|
|
|
enable = mkEnableOption "Status Notifier Watcher";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
default = pkgs.haskellPackages.status-notifier-item;
|
2020-02-02 00:39:17 +01:00
|
|
|
defaultText =
|
|
|
|
literalExample "pkgs.haskellPackages.status-notifier-item";
|
2018-07-19 23:29:47 +02:00
|
|
|
type = types.package;
|
|
|
|
example = literalExample "pkgs.haskellPackages.status-notifier-item";
|
2020-02-02 00:39:17 +01:00
|
|
|
description =
|
|
|
|
"The package to use for the status notifier watcher binary.";
|
2018-07-19 23:29:47 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.user.services.status-notifier-watcher = {
|
2020-02-02 00:39:17 +01:00
|
|
|
Unit = {
|
|
|
|
Description = "SNI watcher";
|
2021-05-22 04:15:12 +02:00
|
|
|
PartOf = [ "tray.target" ];
|
2020-02-02 00:39:17 +01:00
|
|
|
Before = [ "taffybar.service" ];
|
|
|
|
};
|
|
|
|
|
2021-05-22 04:15:12 +02:00
|
|
|
Service = {
|
|
|
|
Type = "dbus";
|
|
|
|
BusName = "org.kde.StatusNotifierWatcher";
|
|
|
|
ExecStart = "${cfg.package}/bin/status-notifier-watcher";
|
2020-02-02 00:39:17 +01:00
|
|
|
};
|
2021-05-22 04:15:12 +02:00
|
|
|
|
|
|
|
Install = { WantedBy = [ "tray.target" "taffybar.service" ]; };
|
2018-07-19 23:29:47 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|