From 94a20654cd6d9df332d5316da87cbdb2d3a0c393 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 4 Dec 2024 07:07:59 +0000 Subject: [PATCH] Move use-package and base16 config to early-init.el Ensure it's run before use-package is used or theme is loaded, since nix puts these at the start of the extra config block Run vdirsyncer when khalel first loaded, before importing, to make sure things are up to date. No run at startup so only affects when first opening email/org-agenda --- system/home/emacs/default.nix | 6 ++++++ system/home/emacs/init.el | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/system/home/emacs/default.nix b/system/home/emacs/default.nix index 842c72cb..063d1270 100644 --- a/system/home/emacs/default.nix +++ b/system/home/emacs/default.nix @@ -5,6 +5,12 @@ ../shell/git.nix ../gpg/default.nix ]; + home.file.".emacs.d/early-init.el".text = '' + (setopt use-package-check-before-init t + use-package-enable-imenu-support t + base16-theme-distinct-fringe-background t + base16-theme-highlight-mode-line 'contrast) + ''; services.emacs = { enable = true; package = config.programs.emacs.finalPackage; diff --git a/system/home/emacs/init.el b/system/home/emacs/init.el index ce86c2c2..ea73fae1 100644 --- a/system/home/emacs/init.el +++ b/system/home/emacs/init.el @@ -1,9 +1,6 @@ ;;; init.el --- Personal Emacs Config ;;; Commentary: ;;; Code: -(setopt use-package-check-before-init t - use-package-enable-imenu-support t) - (use-package package :config (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) @@ -179,7 +176,7 @@ (use-package khalel :after (org-agenda) - :commands (khalel-import-events khalel-add-capture-template khalel-run-vdirsyncer) + :commands (khalel-run-vdirsyncer khalel-import-events khalel-add-capture-template) :custom (khalel-default-alarm "10") (khalel-default-calendar nil) @@ -190,6 +187,7 @@ (khalel-import-end-date "+365d") (khalel-import-org-file-header "#+TITLE: khalel imported calendar events\n#+COLUMNS: %ITEM %TIMESTAMP %LOCATION %CALENDAR\n#+CATEGORY: Calendar\n\n") :config + (khalel-run-vdirsyncer) (khalel-import-events) (khalel-add-capture-template))