{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.hive.themes.layan;
in {
  options.hive.themes.layan = {
    enable = lib.mkEnableOption "Layan theme configuration";
    pkgsInHome = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = "Whether to install Layan theme packages in the user's home directory.";
    };
  };

  config = lib.mkIf cfg.enable {
    home.packages = lib.optionals cfg.pkgsInHome [
      pkgs.hive.layan-qt6
      pkgs.kdePackages.qtstyleplugin-kvantum
      pkgs.unstable.layan-cursors
      pkgs.layan-gtk-theme
      pkgs.tela-circle-icon-theme
    ];

    qt.enable = false;
    qt.style.name = "kvantum";
    qt.style.package = pkgs.kdePackages.qtstyleplugin-kvantum;
    qt.platformTheme.name = "gtk";
    systemd.user.settings.Manager.DefaultEnvironment = lib.mapAttrs (_: lib.mkDefault) {
      QT_STYLE_OVERRIDE = "kvantum";
      QT_QPA_PLATFORMTHEME = "gtk";
    };
    xdg.configFile."Kvantum/kvantum.kvconfig".text = lib.generators.toINI {} {
      General.theme = "LayanDark";
    };

    # add nord like gtk theme
    gtk = {
      enable = true;
      cursorTheme = {
        package = pkgs.unstable.layan-cursors;
        name = "Layan-cursors";
      };
      theme = {
        package = pkgs.layan-gtk-theme;
        name = "Layan-Dark";
      };
      iconTheme = {
        package = pkgs.tela-circle-icon-theme;
        name = "Tela-circle-dark";
      };
    };
  };
}
