anchor.diff:              else ", restart_service: :${config.restart_service}"
             );
         };
  +  };
  +
  +  caskOptions = { config, ...  }: {
  +    options = {
  +      name = mkOption {
  +        type = types.str;
  +        description = "The name of the cask to install.";
  +      };
  +      args = mkOption {
  +        type = types.nullOr (types.submodule caskArgsOptions);
  +        default = null;
  +      };
  +      greedy = mkNullOrBoolOption {
  +        description = ''
  +          Whether to always upgrade auto-updated or unversioned cask to latest version even if
  +          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}";
  +    };
     };
   in
   
  
positive.code:     };
  
      casks = mkOption {
        type = with types; listOf str;
        default = [];
        example = [ "hammerspoon" "virtualbox" ];
        description = "Homebrew casks to install.";
      };
  
      masApps = mkOption {
  
negative.code:       type = types.lines;
        default = "";
        example = ''
          # 'brew cask install' only if '/usr/libexec/java_home --failfast' fails
          cask "java" unless system "/usr/libexec/java_home --failfast"
        '';
        description = "Extra lines to be added verbatim to bottom of the generated Brewfile.";
      };
    };
  
  