anchor.diff:        default = "/var/lib/hass";
         type = types.path;
         description = "The config directory, where your <filename>configuration.yaml</filename> is located.";
  +    };
  +
  +    port = mkOption {
  +      default = 8123;
  +      type = types.int;
  +      description = "The port on which to listen.";
  +    };
  +
  +    applyDefaultConfig = mkOption {
  +      default = true;
  +      type = types.bool;
  +      description = ''
  +        Setting this option enables a few configuration options for HA based on NixOS configuration (such as time zone) to avoid having to manually specify configuration we already have.
  +        </para>
  +        <para>
  +        Currently one side effect of enabling this is that the <literal>http</literal> component will be enabled.
  +        </para>
  +        <para>
  +        This only takes effect if <literal>config != null</literal> in order to ensure that a manually managed <filename>configuration.yaml</filename> is not overwritten.
  +      '';
       };
   
       config = mkOption {
  
positive.code:     then (cfg.package.override { inherit extraComponents; })
      else cfg.package;
  
  in {
    meta.maintainers = with maintainers; [ dotlambda ];
  
  
negative.code: let
    cfg = config.services.home-assistant;
  
    configFile = pkgs.writeText "configuration.json" (builtins.toJSON (if cfg.applyDefaultConfig
      then (lib.recursiveUpdate defaultConfig (if (isNull cfg.config) then {} else cfg.config))
      else cfg.config));
  
    availableComponents = pkgs.home-assistant.availableComponents;
  
  