{
  pkgs,
  inputs,
  ...
}: let
  qs_config = pkgs.callPackage ./quick_config/quick.nix {};
  quick_shell = inputs.quickshell.packages.${pkgs.system}.default;
in {
  environment.systemPackages = [quick_shell];

  systemd.user.services.quickshell = {
    description = "quickshell desktop shell";
    wantedBy = ["graphical-session.target"];
    partOf = ["graphical-session.target"];
    after = ["graphical-session.target"];

    serviceConfig = {
      ExecStart = "${quick_shell}/bin/qs -c ${qs_config}";
      Restart = "on-failure";
      RestartSec = 3;
    };
  };

  system.userActivationScripts.restartQuickshell = ''
    ${pkgs.systemd}/bin/systemctl --user restart quickshell.service || true
  '';
}
