{ pkgs, ... }:

{
  home.packages = with pkgs; [
    walker
    elephant
  ];

  systemd.user.services.elephant = {
    Unit = {
      Description = "Elephant backend service";
      PartOf = [ "graphical-session.target" ];
      After = [ "graphical-session.target" ];
    };

    Service = {
      ExecStart = "${pkgs.elephant}/bin/elephant";
      Restart = "on-failure";
      RestartSec = 5;
    };
  };

  systemd.user.services.walker = {
    Unit = {
      Description = "Walker application service";
      PartOf = [ "graphical-session.target" ];
      After = [ "elephant.service" "graphical-session.target" ];
      Requires = [ "elephant.service" ];
    };

    Service = {
      ExecStart = "${pkgs.walker}/bin/walker --gapplication-service";
      Restart = "on-failure";
      RestartSec = 5;
    };
  };

  wayland.windowManager.hyprland.settings.exec-once = [
    "dbus-update-activation-environment --systemd --all"
    "systemctl --user start elephant.service walker.service"
  ];
}
