anchor.diff:        optional (cfg.masApps != {}) "mas" ++
         optional (cfg.whalebrews != []) "whalebrew";
   
  -    environment.variables = mkIf cfg.enable (
  -      optionalAttrs cfg.userConfig.brewfile { HOMEBREW_BUNDLE_FILE = "${brewfile}"; } //
  -      optionalAttrs cfg.userConfig.noLock { HOMEBREW_BUNDLE_NO_LOCK = "1"; }
  -    );
  +    environment.variables = mkIf cfg.enable {
  +      HOMEBREW_BUNDLE_FILE = "${brewfile}";
  +      HOMEBREW_BUNDLE_NO_LOCK = "1";
  +    };
   
       system.activationScripts.homebrew.text = mkIf cfg.enable ''
         # Homebrew Bundle
  
positive.code:       '';
      };
  
      userConfig.brewfile = mkOption {
        type = types.bool;
        default = true;
        description = ''
          When enabled, when you manually invoke <command>brew bundle</command>, it will automatically
          use the Brewfile in the Nix store that this module generates.
  
          Sets the <literal>HOMEBREW_BUNDLE_FILE</literal> enviroment variable to the path of the
          Brewfile in the Nix store that this module generates, by adding it to
          <option>environment.variables</option>.
        '';
      };
  
      userConfig.noLock = mkOption {
        type = types.bool;
        default = true;
        description = ''
          When enabled, lock files aren't generated when you manually invoke
          <command>brew bundle</command>.
  
          Sets the <literal>HOMEBREW_BUNDLE_NO_LOCK</literal> enviroment variable, by adding it to
          <option>environment.variables</option>.
        '';
      };
  
      taps = mkOption {
        type = with types; listOf str;
        default = [];
        example = [ "homebrew/cask-fonts" ];
        description = "Homebrew formula repositories to tap";
      };
  
      brews = mkOption {
        type = with types; listOf str;
        default = [];
        example = [ "mas" ];
        description = "Homebrew brews to install";
      };
  
      casks = mkOption {
        type = with types; listOf str;
        default = [];
        example = [ "hammerspoon" "virtualbox" ];
        description = "Homebrew casks to install";
      };
  
      masApps = mkOption {
        type = with types; attrsOf int;
        default = {};
        example = {
          "1Password" = 1107421413;
  
negative.code:         <option>homebrew.cleanup</option> is set to <literal>"uninstall"</literal>
          or <literal>"zap"</literal> (this is currently a limitation of Homebrew Bundle).
  
          For more information on <command>mas</command> see: https://github.com/mas-cli/mas.
        '';
      };
  
  