fork/home-manager
git clone https://git.julia.blue/fork/home-manager
8045eb45
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let cfg = config . services . pasystray ; 6 7in { 8meta . maintainers = [ hm . maintainers . pltanton ]; 9 10options = { 11services . pasystray = { 12enable = mkEnableOption "PulseAudio system tray" ; 13 14extraOptions = mkOption { 15type = types . listOf types . str ; 16default = [ ]; 17description = '' 18Extra command-line arguments to pass to {command}`pasystray`. 19'' ; 20}; 21}; 22}; 23 24config = mkIf cfg . enable { 25assertions = [ 26( hm . assertions . assertPlatform "services.pasystray" pkgs platforms . linux ) 27]; 28 29systemd . user . services . pasystray = { 30Unit = { 31Description = "PulseAudio system tray" ; 32Requires = [ "tray.target" ]; 33After = [ "graphical-session-pre.target" "tray.target" ]; 34PartOf = [ "graphical-session.target" ]; 35}; 36 37Install = { WantedBy = [ "graphical-session.target" ]; }; 38 39Service = { 40Environment = 41let toolPaths = makeBinPath [ pkgs . paprefs pkgs . pavucontrol ]; 42in [ "PATH= ${ toolPaths } " ]; 43ExecStart = escapeShellArgs 44([ " ${ pkgs . pasystray } /bin/pasystray" ] ++ cfg . extraOptions ); 45}; 46}; 47}; 48}