mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-01 12:17:26 -05:00
53 lines
2.2 KiB
EmacsLisp
53 lines
2.2 KiB
EmacsLisp
;;; -*- lexical-binding: t; -*-
|
|
|
|
;;; Skip Emacs's own package verification and let Nix do it for us.
|
|
;;;
|
|
;;; Having gnupg around the build triggers Emacs to use it for package signature
|
|
;;; verification. This would not work anyway because the build sandbox does not
|
|
;;; have a properly configured user home and environment.
|
|
(setq package-check-signature nil)
|
|
|
|
;;; For gccEmacs compatibility
|
|
(with-eval-after-load "comp"
|
|
;; The advice for 'kill-emacs would result in eln files being written before
|
|
;; doom would set up proper load paths
|
|
(when (boundp 'comp-never-optimize-functions)
|
|
;; TODO Remove this when emacs 28 become stable.
|
|
(add-to-list 'comp-never-optimize-functions 'kill-emacs))
|
|
(when (boundp 'native-comp-never-optimize-functions)
|
|
(add-to-list 'native-comp-never-optimize-functions 'kill-emacs))
|
|
)
|
|
|
|
(defun nix-straight-inhibit-kill-emacs (arg)
|
|
(message "[nix-doom-emacs] Inhibiting (kill-emacs)"))
|
|
|
|
(advice-add 'nix-straight-get-used-packages
|
|
:around (lambda (ns-fn &rest r)
|
|
(message "[nix-doom-emacs] Advising doom to keep it alive...")
|
|
(advice-add 'doom-autoloads-reload
|
|
:override (lambda (&optional file force-p)
|
|
(message "[nix-doom-emacs] Skipping generating autoloads...")))
|
|
(advice-add 'kill-emacs
|
|
:override #'nix-straight-inhibit-kill-emacs)
|
|
(apply ns-fn r)
|
|
(advice-remove 'kill-emacs 'nix-straight-inhibit-kill-emacs)))
|
|
|
|
(advice-add 'y-or-n-p
|
|
:override (lambda (q)
|
|
(message "%s \n[nix-doom-emacs] --> answering NO" q)
|
|
nil))
|
|
|
|
;;; org is not installed from git, so no fixup is needed
|
|
(advice-add '+org-fix-package-h
|
|
:override (lambda (&rest r)))
|
|
|
|
;; don't try adding the git hooks
|
|
(advice-add 'doom-cli--ci-deploy-hooks
|
|
:override (lambda (&rest r)))
|
|
|
|
;; just use straight provided by nix
|
|
(advice-add 'doom-initialize-core-packages
|
|
:override (lambda (&rest r)
|
|
(require 'straight)
|
|
(straight--make-build-cache-available)))
|