anchor.diff:        };
         greedy = mkNullOrBoolOption {
           description = ''
  -          Whether to always upgrade auto-updated or unversioned cask to latest version even if
  -          already installed.
  +          Whether to always upgrade auto-updated or unversioned cask to the latest version even if
  +          it's already installed.
           '';
         };
   
         brewfileLine = mkBrewfileLineOption;
       };
   
  -    config = {
  -      brewfileLine = ''cask "${config.name}"''
  -      + optionalString (config.args != null)
  -        '', args: { ${removePrefix "cask_args " config.args.brewfileLine} }''
  -      + optionalString (config.greedy != null) ", greedy: ${boolToString config.greedy}";
  -    };
  +    config =
  +      let
  +        sCfg = mkProcessedSubmodConfig config;
  +        sCfgSubset = removeAttrs sCfg [ "name" ];
  +      in
  +      {
  +        brewfileLine =
  +          "cask ${sCfg.name}"
  +          + optionalString (sCfgSubset != { }) ", ${mkBrewfileLineOptionsListString sCfgSubset}";
  +      };
     };
   in
   
   {
  +  # Interface --------------------------------------------------------------------------------------
  +
     options.homebrew = {
       enable = mkEnableOption ''
         configuring your Brewfile, and installing/updating the formulas therein via
         the <command>brew bundle</command> command, using <command>nix-darwin</command>.
   
  -      Note that enabling this option does not install Homebrew. See the Homebrew website for
  -      installation instructions: https://brew.sh
  +      Note that enabling this option does not install Homebrew. See the Homebrew
  +      <link xlink:href="https://brew.sh">website</link> for installation instructions
       '';
   
       autoUpdate = mkOption {
         type = types.bool;
         default = false;
         description = ''
  -        When enabled, Homebrew is allowed to auto-update during <command>nix-darwin</command>
  +        Whether to enable Homebrew to auto-update during <command>nix-darwin</command>
           activation. The default is <literal>false</literal> so that repeated invocations of
           <command>darwin-rebuild switch</command> are idempotent.
         '';
  
positive.code: let
    cfg = config.homebrew;
  
    mkBrewfileSectionString = heading: type: entries: optionalString (entries != []) ''
      # ${heading}
      ${concatMapStringsSep "\n" (v: v.brewfileLine or ''${type} "${v}"'') entries}
  
    '';
  
    mkMasBrewfileSectionString = entries: optionalString (entries != {}) (
      "# Mac App Store apps\n" +
      concatStringsSep "\n" (mapAttrsToList (name: id: ''mas "${name}", id: ${toString id}'') entries) +
      "\n"
    );
  
    brewfile = pkgs.writeText "Brewfile" (
      mkBrewfileSectionString "Taps" "tap" cfg.taps +
      mkBrewfileSectionString "Arguments for all casks" "cask_args"
        (optional (cfg.caskArgs.brewfileLine != null) cfg.caskArgs) +
      mkBrewfileSectionString "Brews" "brew" cfg.brews +
      mkBrewfileSectionString "Casks" "cask" cfg.casks +
      mkMasBrewfileSectionString cfg.masApps +
      mkBrewfileSectionString "Docker containers" "whalebrew" cfg.whalebrews +
      optionalString (cfg.extraConfig != "") ("# Extra config\n" + cfg.extraConfig)
    );
  
    brew-bundle-command = concatStringsSep " " (
      optional (!cfg.autoUpdate) "HOMEBREW_NO_AUTO_UPDATE=1" ++
      [ "brew bundle --file='${brewfile}' --no-lock" ] ++
      optional (cfg.cleanup == "uninstall" || cfg.cleanup == "zap") "--cleanup" ++
      optional (cfg.cleanup == "zap") "--zap"
    );
  
    mkBrewfileLineValueString = v:
      if isInt v then toString v
  
negative.code:       '';
      };
  
      caskArgs = mkOption {
        type = types.submodule caskArgsOptions;
        default = { };
        example = literalExpression ''
          {
            appdir = "~/Applications";
            require_sha = true;
          }
        '';
        description = "Arguments to apply to all <option>homebrew.casks</option>.";
      };
  
      brews = mkOption {
        type = with types; listOf (coercedTo str (name: { inherit name; }) (submodule brewOptions));
        default = [ ];
        example = literalExpression ''
          # Adapted examples from https://github.com/Homebrew/homebrew-bundle#usage
          [
            # `brew install`
            "imagemagick"
  
            # `brew install --with-rmtp`, `brew services restart` on version changes
            {
              name = "denji/nginx/nginx-full";
              args = [ "with-rmtp" ];
              restart_service = "changed";
            }
  
            # `brew install`, always `brew services restart`, `brew link`, `brew unlink mysql` (if it is installed)
            {
              name = "mysql@5.6";
              restart_service = true;
  