From b8133c7971787c369bb9d3a6f549c3c9f22d4429 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 2 Dec 2024 17:43:29 +0000 Subject: [PATCH] Move Emacs config into nix Combine with extraConfig.el as init.el Add missing ligature package Remove sync-emacs script and alias, set sync-all back to actually syncing everything --- system/home/emacs/default.nix | 3 +- system/home/emacs/extraConfig.el | 42 ------------------------- system/home/emacs/init.el | 24 +++----------- system/home/scripts/default.nix | 1 - system/home/scripts/shell/sync-emacs.sh | 14 --------- system/home/shell/default.nix | 4 +-- 6 files changed, 9 insertions(+), 79 deletions(-) delete mode 100644 system/home/emacs/extraConfig.el delete mode 100755 system/home/scripts/shell/sync-emacs.sh diff --git a/system/home/emacs/default.nix b/system/home/emacs/default.nix index 06af7823..e3be9d87 100644 --- a/system/home/emacs/default.nix +++ b/system/home/emacs/default.nix @@ -20,7 +20,7 @@ withImageMagick = true; withPgtk = true; }; - extraConfig = builtins.readFile ./extraConfig.el; + extraConfig = builtins.readFile ./init.el; extraPackages = epkgs: with epkgs; [ # UI and Appearance @@ -34,6 +34,7 @@ khalel mu4e # Other (TODO sort) + ligature which-key diff-hl org-roam diff --git a/system/home/emacs/extraConfig.el b/system/home/emacs/extraConfig.el deleted file mode 100644 index be0fb977..00000000 --- a/system/home/emacs/extraConfig.el +++ /dev/null @@ -1,42 +0,0 @@ -(defun my/configure-theme () - "Load theme and configure some faces." - (interactive) - - ;; Set some font-lock faces to be italic - (set-face-attribute 'font-lock-doc-face nil :slant 'italic) - (set-face-attribute 'font-lock-comment-face nil :slant 'italic) - (set-face-attribute 'font-lock-comment-delimiter-face nil :slant 'italic) - - ;; Change outline headers to follow rainbow order - (require 'outline) - (when (boundp 'base16-stylix-theme-colors) - (dolist (pairing '((outline-1 . :base08) - (outline-2 . :base09) - (outline-3 . :base0A) - (outline-4 . :base0B) - (outline-5 . :base0C) - (outline-6 . :base0D) - (outline-7 . :base0E) - (outline-8 . :base0F))) - (set-face-attribute (car pairing) nil - :foreground - (plist-get base16-stylix-theme-colors (cdr pairing)))) - - (require 'org-faces) - ;; Lighten `org-agenda-clocking' background to be more legible. - (set-face-attribute 'org-agenda-clocking nil :background - (plist-get base16-stylix-theme-colors :base01)) - ;; Set `org-hide' face to actually match background colour - (set-face-attribute 'org-hide nil :foreground - (plist-get base16-stylix-theme-colors :base00)) - (with-eval-after-load 'org-noter - (set-face-attribute 'org-noter-no-notes-exist-face nil :foreground - (plist-get base16-stylix-theme-colors :base08)) - (set-face-attribute 'org-noter-notes-exist-face nil :foreground - (plist-get base16-stylix-theme-colors :base0B)))) - ) - -(with-eval-after-load 'base16-theme - (require 'server) - (add-hook 'after-init-hook (lambda () (my/configure-theme))) - (add-hook 'server-after-make-frame-hook (lambda () (my/configure-theme)))) diff --git a/system/home/emacs/init.el b/system/home/emacs/init.el index 6b13b563..6ba2eb5e 100644 --- a/system/home/emacs/init.el +++ b/system/home/emacs/init.el @@ -10,7 +10,6 @@ (setq user-full-name "Evie Litherland-Smith" user-mail-address "evie@xenia.me.uk" - custom-file (locate-user-emacs-file "custom.el") use-short-answers t kill-do-not-save-duplicates t) @@ -19,7 +18,7 @@ (global-auto-revert-mode +1) (delete-selection-mode +1) -(setq warning-minimum-level :error) +;; (setq warning-minimum-level :error) (keymap-global-set "" #'previous-buffer) (keymap-global-set "" #'next-buffer) @@ -28,10 +27,6 @@ (use-package secrets) -(setq inhibit-splash-screen t - initial-frame-alist nil - default-frame-alist nil) - (setq-default truncate-lines t truncate-partial-width-windows nil) @@ -173,13 +168,11 @@ (window-height . 0.2) (window-parameters . ((no-delete-other-windows . t)))))) -(use-package mu4e-icalendar - :after (mu4e org-agenda) - :functions (mu4e-icalendar-setup) - :custom - (mu4e-icalendar-trash-after-reply nil) +(use-package gnus-icalendar + :after (calendar mu4e org-agenda) + :functions (gnus-icalendar-setup) :config - (mu4e-icalendar-setup)) + (gnus-icalendar-setup)) (use-package khalel :if (package-installed-p 'khalel) @@ -1374,13 +1367,6 @@ ;; Scratch buffer shortcut (keymap-global-set "C-c w x" #'scratch-buffer) -;; Config file shortcut -(defun my/open-config-file () - "Open Emacs config file." - (interactive) - (find-file (locate-user-emacs-file "README.org"))) -(keymap-global-set "C-c w e" #'my/open-config-file) - ;; Tempel template file shortcut (defun my/open-template-file () "Open `tempel' template file." diff --git a/system/home/scripts/default.nix b/system/home/scripts/default.nix index e860aa6a..9eb06183 100644 --- a/system/home/scripts/default.nix +++ b/system/home/scripts/default.nix @@ -2,7 +2,6 @@ { home.packages = [ (pkgs.writeShellScriptBin "sync-git" (builtins.readFile ./shell/sync-git.sh)) - (pkgs.writeShellScriptBin "sync-emacs" (builtins.readFile ./shell/sync-emacs.sh)) (pkgs.writeShellScriptBin "ensure-pass" (builtins.readFile ./shell/ensure-pass.sh)) (pkgs.writeShellScriptBin "clean-config" (builtins.readFile ./shell/clean-config.sh)) (pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh)) diff --git a/system/home/scripts/shell/sync-emacs.sh b/system/home/scripts/shell/sync-emacs.sh deleted file mode 100755 index d410bbf2..00000000 --- a/system/home/scripts/shell/sync-emacs.sh +++ /dev/null @@ -1,14 +0,0 @@ -# Clone ~/.config/emacs/ if it doesn't exist -EMACS_DIR="$HOME/.emacs.d" -if [ ! -d "$EMACS_DIR" ]; then - git clone "https://git.xenia.me.uk/pixelifytica/emacs.git" "$EMACS_DIR" -fi -( - cd "$EMACS_DIR" || exit 1 - # Pull changes by fast-forwarding only - git pull --ff --ff-only - # Update submodules for local packages - git submodule update --init --recursive - # Install and update extensions - make install -) diff --git a/system/home/shell/default.nix b/system/home/shell/default.nix index 3b39c289..5fa2ef26 100644 --- a/system/home/shell/default.nix +++ b/system/home/shell/default.nix @@ -8,8 +8,8 @@ ./cava.nix ]; home.shellAliases = { - sync-all = "sync-git; sync-emacs"; - sync-and-shutdown = "sync-git && vdirsyncer sync && mbsync -a && shutdown now"; + sync-all = "sync-git; vdirsyncer sync; mbsync -a"; + sync-and-shutdown = "sync-all && shutdown now"; protonup = "sudo wg-quick up protonvpn && sudo wg"; protondown = "sudo wg-quick down protonvpn"; };