{
  pkgs,
  lib,
  inputs,
  mainUser,
  config,
  ...
}:
let
  inherit (lib) getExe getExe';
  inherit (config) rice;
in
{
  # quickshell stuff
  environment.systemPackages =
    builtins.attrValues {
      inherit (pkgs.kdePackages) qtbase qtdeclarative;
      inherit (pkgs) wl-clipboard;
    }
    ++ [
      (inputs.quickshell.packages.${pkgs.system}.default.override {
        withHyprland = false;
        withI3 = false;
      })
    ];

  hm.systemd.user.services.quickshell = {
    Unit.PartOf = [ "graphical-session.target" ];
    Unit.After = [
      "graphical-session.target"
      "niri.service"
    ];
    Install.WantedBy = [ "graphical-session.target" ];
    Service = {
      ExecStart = "${getExe' (inputs.quickshell.packages.${pkgs.system}.default.override {
        withHyprland = false;
        withI3 = false;
      }) "qs"}";
    };
  };

  hm.quickServices = {
    "swaync" = "${getExe pkgs.swaynotificationcenter}";
    "swaybg" = "${getExe pkgs.swaybg} -m fill -i ${rice.bg.src}";
    "swayidle" =
      let
        niri = inputs.niri.packages.${pkgs.system}.niri-unstable;
        systemctl = getExe' pkgs.systemd "systemctl";
      in
      ''
        ${lib.getExe pkgs.swayidle} -w \
          timeout 1800 '${systemctl} suspend' \
          timeout 600 '${niri} msg action power-off-monitors'
      '';
  };

  hm.systemd.user.targets.tray = {
    Unit = {
      Description = "Home Manager System Tray";
      Requires = [ "graphical-session.target" ];
    };
  };

  imports = [ inputs.arbys.nixosModules.arbys ];
  environment = {
    arbys = {
      enable = true;
      clobber = true;
    };
    files."/home/${mainUser}/.config/quickshell" = {
      source = "/home/${mainUser}/.nix/graphical/shell/quickshell";
      uid = 1000;
      gid = 100;
    };
  };
}
