aboutsummaryrefslogtreecommitdiff
path: root/modules/services/status-notifier-watcher.nix
diff options
context:
space:
mode:
authorAnton Plotnikov <plotnikovanton@gmail.com>2018-07-20 00:29:47 +0300
committerRobert Helgesson <robert@rycee.net>2018-07-31 15:33:57 +0200
commit2e9e1909dacbe22539855857bf6ee0d01300bae6 (patch)
tree15eca57a2d00f4e8527778aad2a5f07b1768f1b9 /modules/services/status-notifier-watcher.nix
parent4f67e8d0c32a51897529eecb3351c3700f1209c0 (diff)
status-notifier-watcher: add service
Diffstat (limited to 'modules/services/status-notifier-watcher.nix')
-rw-r--r--modules/services/status-notifier-watcher.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/services/status-notifier-watcher.nix b/modules/services/status-notifier-watcher.nix
new file mode 100644
index 00000000000..08c668bf050
--- /dev/null
+++ b/modules/services/status-notifier-watcher.nix
@@ -0,0 +1,46 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.services.status-notifier-watcher;
+
+in
+
+{
+ meta.maintainers = [ maintainers.pltanton ];
+
+ options = {
+ services.status-notifier-watcher = {
+ enable = mkEnableOption "Status Notifier Watcher";
+
+ package = mkOption {
+ default = pkgs.haskellPackages.status-notifier-item;
+ defaultText = "pkgs.haskellPackages.status-notifier-item";
+ type = types.package;
+ example = literalExample "pkgs.haskellPackages.status-notifier-item";
+ description = "The package to use for the status notifier watcher binary.";
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ systemd.user.services.status-notifier-watcher = {
+ Unit = {
+ Description = "SNI watcher";
+ After = [ "graphical-session-pre.target" ];
+ PartOf = [ "graphical-session.target" ];
+ Before = [ "taffybar.service" ];
+ };
+
+ Service = {
+ ExecStart = "${cfg.package}/bin/status-notifier-watcher";
+ };
+
+ Install = {
+ WantedBy = [ "graphical-session.target" "taffybar.service" ];
+ };
+ };
+ };
+}