 ;;; Customization
 ;;;
 
-(defvar homectl-dir (concat (getenv "HOME") "/.homectl")
+(defconst homectl-dir (concat (getenv "HOME") "/.homectl")
   "The location of the homectl directory.  You should not change
   this unless you're a homectl developer and you change it in all
   the other places where it's hard-coded. :)")
+
+(defconst homectl-bin (concat homectl-dir "/common/bin/hc"))
 
 (defgroup homectl nil "Homectl configuration options" :tag "Homectl")
 


  ; Find all the enabled homectl packages and load them/add them to Emacs's
  ; paths.
  (homectl-foreach-enabled pkg
    (homectl-enable-pkg pkg)))


;;; Startup-related utility functions
;;;

(defun homectl-enable-pkg (pkg-path)
  "Enable a single homectl package, located at /pkg-path/."

  (let ((start-file (concat pkg-path "/" "emacs.el")))

    ; Load the package's startup file
    (when (file-exists-p start-file)
      (load-file start-file))))

(defun homectl-update-env (var hook)
  (let
      ((new-path (process-lines homectl-bin "path" "-n" hook var)))
        (setenv var (mapconcat #'identity new-path path-separator))
        (message (concat "[homectl] Updating " var ": " (getenv var)))))



