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 {
|
2018-07-19 21:29:47 +00: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-01 23:39:17 +00:00
|
|
|
defaultText =
|
|
|
|
literalExample "pkgs.haskellPackages.status-notifier-item";
|
2018-07-19 21:29:47 +00:00
|
|
|
type = types.package;
|
|
|
|
example = literalExample "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 {
|
|
|
|
systemd.user.services.status-notifier-watcher = {
|
2020-02-01 23:39:17 +00:00
|
|
|
Unit = {
|
|
|
|
Description = "SNI watcher";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
Before = [ "taffybar.service" ];
|
|
|
|
};
|
|
|
|
|
2020-06-10 21:32:44 +00:00
|
|
|
Service = {
|
|
|
|
ExecStart = "${cfg.package}/bin/status-notifier-watcher";
|
|
|
|
# Delay the unit start a bit to allow the program to get fully
|
|
|
|
# set up before letting dependent services start. This is
|
|
|
|
# brittle and a better solution using, e.g., `BusName=` might
|
|
|
|
# be possible.
|
|
|
|
ExecStartPost = "${pkgs.coreutils}/bin/sleep 1";
|
|
|
|
};
|
2020-02-01 23:39:17 +00:00
|
|
|
|
|
|
|
Install = {
|
|
|
|
WantedBy = [ "graphical-session.target" "taffybar.service" ];
|
|
|
|
};
|
2018-07-19 21:29:47 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|