{ pkgs
, lib
, config
, ... }: with lib; let
  cfg = config.home.headless;
in {
  options.home.headless = {
    enable = mkOption {
      type = with types; nullOr str;
      default = null;
      description = "a headless, remotely viewed sway display";
    };

    output = mkOption {
      type = with types; attrsOf str;
      default = {
        # pixel tablet
        mode = "2560x1600";
        scale = "2";
        pos = "1920 0";
      };
      description = "headless display configuration";
    };

    host = mkOption {
      type = with types; str;
      default = "0.0.0.0";
      description = "wayvnc listen host";
    };

    port = mkOption {
      type = with types; port;
      # utility port
      default = 1300;
      description = "wayvnc listen port";
    };

    extraArgs = mkOption {
      type = with types; str;
      default = "--max-fps=60";
      description = "extra wayvnc args";
    };
  };

  config = {
    users.homeModules = [
      # this module passes headless configuration to home-manager
      { passthrough.headless = cfg; }
    ];
  };
}