aboutsummaryrefslogtreecommitdiff
path: root/modules/services/pasystray.nix
blob: 7c6651d9499ca5415f4dff4c42b97eb7c670f9ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ config, lib, pkgs, ... }:

with lib;

{
  meta.maintainers = [ maintainers.pltanton ];

  options = {
    services.pasystray = { enable = mkEnableOption "PulseAudio system tray"; };
  };

  config = mkIf config.services.pasystray.enable {
    systemd.user.services.pasystray = {
      Unit = {
        Description = "PulseAudio system tray";
        After = [ "graphical-session-pre.target" ];
        PartOf = [ "graphical-session.target" ];
      };

      Install = { WantedBy = [ "graphical-session.target" ]; };

      Service = {
        Environment =
          let toolPaths = makeBinPath [ pkgs.paprefs pkgs.pavucontrol ];
          in [ "PATH=${toolPaths}" ];
        ExecStart = "${pkgs.pasystray}/bin/pasystray";
      };
    };
  };
}