Advertisement
Guest User

Untitled

a guest
May 19th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. { pkgs, lib, config, ... }:
  2. with lib;
  3. let
  4. notifyScript = ''
  5. %s -c '[ $SERVICE_RESULT = success ] || echo "Systemd user service %N exited with exit code $EXIT_STATUS, run this command to start finding out why: \'journalctl --user -eu %N.service\'" | xargs intray add'
  6. '';
  7.  
  8. in
  9. {
  10.  
  11. config.systemd.user.services =
  12. let serviceNames = lib.attrNames config.systemd.user.services;
  13. in
  14. (lib.genAttrs serviceNames
  15. (serviceName: { Service.ExecStopPost = notifyScript; } ));
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement