1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39:46 +01:00
home-manager/modules/services/status-notifier-watcher.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

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 {
meta.maintainers = [ hm.maintainers.pltanton ];
2018-07-19 23:29:47 +02:00
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 =
literalExpression "pkgs.haskellPackages.status-notifier-item";
2018-07-19 23:29:47 +02:00
type = types.package;
example = literalExpression "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 {
assertions = [
(lib.hm.assertions.assertPlatform "services.status-notifier-watcher" pkgs
lib.platforms.linux)
];
2018-07-19 23:29:47 +02:00
systemd.user.services.status-notifier-watcher = {
2020-02-02 00:39:17 +01:00
Unit = {
Description = "SNI watcher";
PartOf = [ "tray.target" ];
2020-02-02 00:39:17 +01:00
Before = [ "taffybar.service" ];
};
Service = {
Type = "dbus";
BusName = "org.kde.StatusNotifierWatcher";
ExecStart = "${cfg.package}/bin/status-notifier-watcher";
2020-02-02 00:39:17 +01:00
};
Install = { WantedBy = [ "tray.target" "taffybar.service" ]; };
2018-07-19 23:29:47 +02:00
};
};
}