(feat) add direnv mode to emacs config

This commit is contained in:
Sakooooo 2024-07-07 17:25:27 +04:00
parent 92cfcc96e6
commit 13b5a8fe8c
Signed by: sako
GPG key ID: 3FD715D87D7725E0

View file

@ -6,43 +6,43 @@
#+end_src #+end_src
* Package Setup * Package Setup
#+begin_src emacs-lisp #+begin_src emacs-lisp
(message "Reached package setup") (message "Reached package setup")
(require `package) (require `package)
(setq package-archives `(("mepla" . "https://melpa.org/packages/") (setq package-archives `(("mepla" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/") ("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/"))) ("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize) (package-initialize)
(unless (package-installed-p 'use-package) (unless (package-installed-p 'use-package)
(progn (progn
(package-refresh-contents) (package-refresh-contents)
(package-install 'use-package))) (package-install 'use-package)))
(require 'use-package) (require 'use-package)
(setq use-package-always-ensure t) (setq use-package-always-ensure t)
;; TODO add better detection to this ;; TODO add better detection to this
(when (eq system-type 'windows-nt) (when (eq system-type 'windows-nt)
(message "setting up straight.el") (message "setting up straight.el")
(defvar bootstrap-version) (defvar bootstrap-version)
(let ((bootstrap-file (let ((bootstrap-file
(expand-file-name (expand-file-name
"straight/repos/straight.el/bootstrap.el" "straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir) (or (bound-and-true-p straight-base-dir)
user-emacs-directory))) user-emacs-directory)))
(bootstrap-version 7)) (bootstrap-version 7))
(unless (file-exists-p bootstrap-file) (unless (file-exists-p bootstrap-file)
(with-current-buffer (with-current-buffer
(url-retrieve-synchronously (url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies) 'silent 'inhibit-cookies)
(goto-char (point-max)) (goto-char (point-max))
(eval-print-last-sexp))) (eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage)) (load bootstrap-file nil 'nomessage))
(setq straight-use-package-by-default t)) (setq straight-use-package-by-default t))
#+end_src #+end_src
* Keybinds * Keybinds
Ill use this later eventually Ill use this later eventually
@ -834,6 +834,13 @@ this should be useful later
:config :config
(treemacs-load-theme "nerd-icons")) (treemacs-load-theme "nerd-icons"))
#+end_src #+end_src
** Direnv
#+begin_src emacs-lisp
(when (eq system-type 'gnu/linux)
(use-package direnv
:config
(direnv-mode)))
#+end_src
* Languages * Languages
#+begin_src emacs-lisp #+begin_src emacs-lisp
(message "Reached languages") (message "Reached languages")