# ~/.config/nixpkgs/modules/jiriks74/zsh/default.nix
{ config, lib, pkgs, ... }:

let
  cfg = config.jiriks74.zsh;
  # Helper to get the path relative to this file
  mkPath = path: ./modules + "/${path}";
in {
  options.jiriks74.zsh = {
    # Option to enable the core Zsh configuration (like programs.zsh.enable)
    enable = lib.mkEnableOption "Enable jiriks74's core zsh configuration";

    # Option to include extra packages
    qolPackages = lib.mkEnableOption "Enable QualityOfLife packages";
  };

  # Conditionally import other Nix files based on the options
  imports =
    # Import core zsh settings if 'enable' is true
    (lib.lists.optionals cfg.enable [ (mkPath "zsh.nix") ])

    # Import packages if 'extraPackages' is true
    ++ (lib.lists.optionals cfg.extraPackages [ (mkPath "packages.nix") ])

    # Add more conditional imports here based on other options
    # ++ (lib.lists.optionals cfg.keybindings [ (mkPath "keybindings.nix") ])
    # ++ (lib.lists.optionals cfg.plugins [ (mkPath "plugins.nix") ])
  ;

  # Base configuration that might always apply or depend on 'enable'
  config = lib.mkMerge [
    # (lib.mkIf cfg.enable {
    #   programs.zsh.enable = true;
    # })
  ];
}