2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.status-notifier-watcher;
|
|
|
|
|
|
|
|
in {
|
2023-01-10 09:35:00 +00:00
|
|
|
meta.maintainers = [ hm.maintainers.pltanton ];
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
|
|
options = {
|
|
|
|
services.status-notifier-watcher = {
|
|
|
|
enable = mkEnableOption "Status Notifier Watcher";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
default = pkgs.haskellPackages.status-notifier-item;
|
|
|
|
defaultText =
|
2021-11-04 16:42:44 +00:00
|
|
|
literalExpression "pkgs.haskellPackages.status-notifier-item";
|
2020-10-12 00:22:58 +00:00
|
|
|
type = types.package;
|
2021-11-04 16:42:44 +00:00
|
|
|
example = literalExpression "pkgs.haskellPackages.status-notifier-item";
|
2020-10-12 00:22:58 +00:00
|
|
|
description =
|
|
|
|
"The package to use for the status notifier watcher binary.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-11-04 16:42:44 +00:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.status-notifier-watcher" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
systemd.user.services.status-notifier-watcher = {
|
|
|
|
Unit = {
|
|
|
|
Description = "SNI watcher";
|
2021-07-02 22:36:30 +00:00
|
|
|
PartOf = [ "tray.target" ];
|
2020-10-12 00:22:58 +00:00
|
|
|
Before = [ "taffybar.service" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2021-07-02 22:36:30 +00:00
|
|
|
Type = "dbus";
|
|
|
|
BusName = "org.kde.StatusNotifierWatcher";
|
2020-10-12 00:22:58 +00:00
|
|
|
ExecStart = "${cfg.package}/bin/status-notifier-watcher";
|
|
|
|
};
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
Install = { WantedBy = [ "tray.target" "taffybar.service" ]; };
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|