                  '("marmalade" . "https://marmalade-repo.org/packages/")))
   (setq warning-minimum-level :error))
 
+(defclass cfgl-layer ()
+  ((name :initarg :name
+         :type symbol
+         :documentation "Name of the layer.")
+   (dir :initarg :dir
+        :type string
+        :documentation "Absolute path to the layer directory.")
+   (ext-dir :initarg :ext-dir
+            :type string
+            :documentation "Absolute path to the exentensions directory.")
+   (variables :initarg :variables
+              :initform nil
+              :type list
+              :documentation "A list of variable-value pairs."))
+  "A configuration layer.")
+
 (defconst configuration-layer-template-directory
   (expand-file-name (concat spacemacs-core-directory "templates/"))
   "Configuration layer templates directory.")

  "Return non-nil if PKG symbol corresponds to a used package."
  (ht-contains? configuration-layer-all-packages pkg))

(defun configuration-layer/layer-usedp (layer)
  "Return non-nil if LAYER symbol corresponds to a used layer."
  (not (null (assq layer configuration-layer-layers))))

(defun configuration-layer/get-layers-list ()
  "Return a list of all discovered layer symbols."
  (ht-keys configuration-layer-paths))

(defun configuration-layer/get-layer-path (layer)
  "Return the path for LAYER symbol."
  (ht-get configuration-layer-paths layer))

(defun configuration-layer/load-layers ()
  "Load all declared layers."
  (let ((layers (reverse configuration-layer-layers)))
    (configuration-layer//set-layers-variables layers)
    ;; first load the config files then the package files
    (configuration-layer//load-layers-files layers '("funcs.el" "config.el"))

of all excluded packages."
  (let (result)
    (dolist (layer layers)
      (let ((excl-var (intern (format "%S-excluded-packages"
                                      (oref layer :name)))))
        (when (boundp excl-var)
          (mapc (lambda (x) (push x result)) (eval excl-var)))))
    result))
