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