emacs: Only install packages when not using nix

This commit is contained in:
caem 2025-04-05 23:47:48 +02:00
parent 156c6504a2
commit 4973eeb922
Signed by: caem
GPG key ID: 69A830D03203405F
13 changed files with 28 additions and 20 deletions

View file

@ -16,12 +16,12 @@
(setq compilation-scroll-output t) (setq compilation-scroll-output t)
(use-package rainbow-delimiters (use-package rainbow-delimiters
:ensure t :ensure nil
:hook :hook
((prog-mode . rainbow-delimiters-mode))) ((prog-mode . rainbow-delimiters-mode)))
(use-package darktooth-theme (use-package darktooth-theme
:ensure t :ensure nil
:config :config
(load-theme 'darktooth-dark t) (load-theme 'darktooth-dark t)
(set-face-background 'hl-line "#262626")) (set-face-background 'hl-line "#262626"))

View file

@ -1,16 +1,16 @@
(use-package smex (use-package smex
:ensure t :ensure nil
:bind :bind
(("M-x" . smex) (("M-x" . smex)
("M-X" . smex-major-mode-commands)) ("M-X" . smex-major-mode-commands))
:config (smex-initialize)) :config (smex-initialize))
(use-package ido-completing-read+ (use-package ido-completing-read+
:ensure t :ensure nil
:config (ido-ubiquitous-mode 1)) :config (ido-ubiquitous-mode 1))
(use-package amx (use-package amx
:ensure t :ensure nil
:config (amx-mode 1)) :config (amx-mode 1))
(ido-mode 1) (ido-mode 1)

View file

@ -1,3 +1,4 @@
(rei/load "nix.el")
(rei/load "repositories.el") (rei/load "repositories.el")
(rei/load "litter.el") (rei/load "litter.el")
(rei/load "appearance.el") (rei/load "appearance.el")

View file

@ -3,7 +3,7 @@
backup-by-copying t) backup-by-copying t)
(use-package no-littering (use-package no-littering
:ensure t :ensure nil
:init :init
(setq no-littering-etc-directory (file-name-concat (xdg-data-home) "emacs") (setq no-littering-etc-directory (file-name-concat (xdg-data-home) "emacs")
no-littering-var-directory (file-name-concat (xdg-data-home) "emacs")) no-littering-var-directory (file-name-concat (xdg-data-home) "emacs"))

View file

@ -0,0 +1,9 @@
;; If we're already using Nix, make sure we're only using
;; the Nix provided packages instead of downloading them from
;; (m)elpa and co as it's not really necassary as we've already
;; got Nix to do this job and this is a much cleaner solution.
(if (file-exists-p "/nix/store")
(setq using-nix t
use-package-always-ensure nil)
(setq using-nix nil
use-package-always-ensure t))

View file

@ -1,8 +1,10 @@
;; Set the elpa directory ahead of loading the no-littering package, as it would (require 'package)
;; otherwise cause it to be installed in the configuration directory as no-littering
;; has to be first insalled from melpa before being able to be called.
(setq package-user-dir (file-name-concat (xdg-data-home) "emacs" "elpa")) (setq package-user-dir (file-name-concat (xdg-data-home) "emacs" "elpa"))
(require 'package) (if using-nix
(progn
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize) (package-initialize))
(progn
(setq package-archives nil)
(package-initialize)))

View file

@ -3,7 +3,7 @@
(setq treesit-font-lock-level 4) (setq treesit-font-lock-level 4)
(use-package treesit-auto (use-package treesit-auto
:ensure t :ensure nil
:custom :custom
(treesit-auto-install 'prompt) (treesit-auto-install 'prompt)
:config :config

View file

@ -5,4 +5,3 @@
(require 'rei) (require 'rei)
(rei/load "core") (rei/load "core")
(rei/load "modes") (rei/load "modes")
(rei/load "plugins")

View file

@ -1,5 +1,5 @@
(use-package paredit (use-package paredit
:ensure t :ensure nil
:hook :hook
((prog-mode . enable-paredit-mode)) ((prog-mode . enable-paredit-mode))
:config :config

View file

@ -1,3 +1,3 @@
(use-package meson-mode (use-package meson-mode
:ensure t :ensure nil
:mode ("meson\\.build\\'")) :mode ("meson\\.build\\'"))

View file

@ -1,5 +1,5 @@
(use-package nix-mode (use-package nix-mode
:ensure t :ensure nil
:mode ("\\.nix\\'" "\\.nix.in\\'") :mode ("\\.nix\\'" "\\.nix.in\\'")
:hook :hook
(nix-mode . (lambda () (nix-mode . (lambda ()

View file

@ -1 +0,0 @@
(rei/load "vterm.el")

View file

@ -1,2 +0,0 @@
(use-package vterm
:ensure t)