{ config, lib, ... }: with lib; let cfg = config.nixfiles.modules.homebrew; in { options.nixfiles.modules.homebrew.enable = mkEnableOption "Homebrew"; config = mkIf cfg.enable { hm.programs.bash.initExtra = mkAfter '' if [ -x "/opt/homebrew/bin/brew" ]; then export PATH="$PATH:/opt/homebrew/bin" fi ''; # This option requires an installed Homebrew[1]. # # [1]: https://daiderd.com/nix-darwin/manual/index.html#opt-homebrew.enable # [1]: https://brew.sh homebrew = { enable = true; onActivation = { autoUpdate = true; upgrade = true; cleanup = "zap"; }; }; }; }