{ config, inputs, ... }:
{
  nix-homebrew = {
    user = config.system.primaryUser;
    enable = true;
    autoMigrate = true;
    enableRosetta = true;
    mutableTaps = false;
    taps = {
      "homebrew/homebrew-core" = inputs.homebrew-core;
      "homebrew/homebrew-cask" = inputs.homebrew-cask;
    };
  };

  # Homebrew
  homebrew = {
    enable = true;
    taps = builtins.attrNames config.nix-homebrew.taps;
    global = {
      autoUpdate = false;
      brewfile = true;
    };
    onActivation = {
      autoUpdate = false;
      cleanup = "zap";
    };
    casks = [
      "aldente"
      "bartender"
      "betterdisplay"
      "chromium"
      "discord"
      "epic-games"
      "gstreamer-runtime"
      "iterm2"
      "jagex"
      "kitty"
      "minecraft"
      "omnissa-horizon-client"
      "onlyoffice"
      "orcaslicer"
      "proton-drive"
      "proton-pass"
      "protonvpn"
      "scroll-reverser"
      "steam"
      "tabby"
      "tg-pro"
      "utm"
      "vesktop"
      "vlc"
      "vscodium"
      "wine-stable"
      # "xpipe"
      "xquartz"
    ];
    masApps = {
      Amphetamine = 937984704;
      Infuse = 1136220934;
      "Proton Pass for Safari" = 6502835663;
      Tailscale = 1475387142;
      Termius = 1176074088;
    };
  };

  # homebrew.global.autoUpdate = true;
}
