From 5e8439739b829032775c9e8d9c8589f001b863bf Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Fri, 22 Dec 2023 18:32:59 +0100 Subject: [PATCH] . --- config.org | 9 +++ config.scm | 11 +++- home/emacs/init.el | 7 +++ home/emacs/init.org | 133 +++++++++++++++++++++++++++++--------------- 4 files changed, 114 insertions(+), 46 deletions(-) diff --git a/config.org b/config.org index fec9258..69901c9 100644 --- a/config.org +++ b/config.org @@ -42,6 +42,7 @@ This is to be run after setting up the partitions. #+NAME: module-list - gnu - gnu image +- zilti packages hyprland - gnu packages gnome - gnu services admin - gnu services authentication @@ -84,11 +85,13 @@ This is to be run after setting up the partitions. - emacs - emacs-xyz - fonts +- gl - pciutils - readline - terminals - version-control - wm +- xdisorg - xorg #+begin_src scheme :noweb yes :exports none :results output :tangle config.scm @@ -151,11 +154,17 @@ This adds the Nonguix channel. ** Packages #+NAME: root-packages +- egl-wayland +- eglexternalplatform - emacs - emacs-desktop-environment - font-terminus - git +- glu - hwdata +- hyprland +- libdrm +- mesa - nss-certs - network-manager - podman diff --git a/config.scm b/config.scm index de53e14..2783e9e 100644 --- a/config.scm +++ b/config.scm @@ -1,6 +1,7 @@ (use-modules (gnu) (gnu image) + (zilti packages hyprland) (gnu packages gnome) (gnu services admin) (gnu services authentication) @@ -27,11 +28,13 @@ emacs emacs-xyz fonts + gl pciutils readline terminals version-control wm + xdisorg xorg) (operating-system @@ -73,11 +76,17 @@ %base-user-accounts)) (packages (append - (list emacs + (list egl-wayland + eglexternalplatform + emacs emacs-desktop-environment font-terminus git + glu hwdata + hyprland + libdrm + mesa nss-certs network-manager podman diff --git a/home/emacs/init.el b/home/emacs/init.el index ff246a4..33c8b1f 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -142,6 +142,13 @@ (global-display-fill-column-indicator-mode t) (pixel-scroll-precision-mode 1)) +(use-package gnus + :custom + (message-send-mail-function 'message-send-mail-with-sendmail) + (sendmail-program "msmtp") + (message-sendmail-f-is-evil t) + (message-sendmail-extra-arguments '("--read-envelope-from"))) + (defun set-buffer-variable-pitch () (interactive) (variable-pitch-mode t) diff --git a/home/emacs/init.org b/home/emacs/init.org index 40746e5..d078932 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -40,30 +40,54 @@ for authorized =.dir-local= variables and similar stuff. ** Package Manager -I use =straight.el= as package manager. +Most packages are being installed using =Guix=, for the few remaining ones that have to be fetched from Git, I use +[[https://github.com/progfolio/elpaca][Elpaca]]. -#+NAME: straight-settings -| Setting | Value | -|-------------------------+-------| -| Use Straight as default | f | +#+begin_src emacs-lisp +(defvar elpaca-installer-version 0.6) +(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) +(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) +(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) +(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil + :files (:defaults "elpaca-test.el" (:exclude "extensions")) + :build (:not elpaca--activate-package))) +(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) + (build (expand-file-name "elpaca/" elpaca-builds-directory)) + (order (cdr elpaca-order)) + (default-directory repo)) + (add-to-list 'load-path (if (file-exists-p build) build repo)) + (unless (file-exists-p repo) + (make-directory repo t) + (when (< emacs-major-version 28) (require 'subr-x)) + (condition-case-unless-debug err + (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (call-process "git" nil buffer t "clone" + (plist-get order :repo) repo))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) + (progn (message "%s" (buffer-string)) (kill-buffer buffer)) + (error "%s" (with-current-buffer buffer (buffer-string)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) + (unless (require 'elpaca-autoloads nil t) + (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (load "./elpaca-autoloads"))) +(add-hook 'after-init-hook #'elpaca-process-queues) +(elpaca `(,@elpaca-order)) +#+end_src -#+begin_src emacs-lisp :var tbl=straight-settings - (defvar bootstrap-version) - (let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) - (bootstrap-version 6)) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage)) - - (let ((settings (car tbl))) - (setq straight-use-package-by-default - (string= "t" (cl-first settings)))) +A few additional lines are necessary to integrate it with =use-package=: +#+begin_src emacs-lisp +(elpaca elpaca-use-package + (elpaca-use-package-mode) + (setq elpaca-use-package-by-default nil)) +(elpaca-wait) #+end_src * Helper Functions @@ -86,28 +110,47 @@ The first one is a function to create conditional keybindings. * Core Emacs Customization :important: -#+begin_src emacs-lisp -(use-package emacs - :delight (eldoc-mode " 󰙎") - :custom - (completion-cycle-threshold 10) - (display-time-mode t) - (enable-recursive-minibuffers t) - (enable-remote-dir-locals t) - (global-hl-line-mode t) - (indent-tabs-mode nil) - (menu-bar-mode nil) - (minibuffer-prompt-properties (read-only t cursor-intangible t face minibuffer-prompt)) - (read-extended-command-predicate #'command-completion-default-include-p) - (recentf-mode t) - (scroll-bar-mode nil) - (tab-always-indent 'complete) - (tool-bar-mode nil) - :custom-face - (default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font")))) - :hook - (minibuffer-setup . cursor-intangible-mode) - :config - (advice-add 'risky-local-variable-p :override #'ignore)) +Enabled core modes: + +#+NAME: enabled-core-modes +- display-time-mode +- global-hl-line-mode +- global-prettify-symbols-mode +- recentf-mode + +Disabled core modes: + +#+NAME: disabled-core-modes +- indent-tabs-mode +- menu-bar-mode +- scroll-bar-mode +- tool-bar-mode + +#+begin_src emacs-lisp :var enabled=enabled-core-modes :var disabled=disabled-core-modes + (use-package emacs + :custom + (completion-cycle-threshold 10) + (display-time-mode t) + (enable-recursive-minibuffers t) + (enable-remote-dir-locals t) + (fill-column 100) + (global-hl-line-mode t) + (global-prettify-symbols-mode t) + (indent-tabs-mode nil) + (menu-bar-mode nil) + (minibuffer-prompt-properties (read-only t cursor-intangible t face minibuffer-prompt)) + (read-extended-command-predicate #'command-completion-default-include-p) + (recentf-mode t) + (scroll-bar-mode nil) + (tab-always-indent 'complete) + (tool-bar-mode nil) + :custom-face + (default ((t (:weight bold :height 113 :width normal :family "VictorMono Nerd Font")))) + :hook + (minibuffer-setup . cursor-intangible-mode) + :config + (advice-add 'risky-local-variable-p :override #'ignore)) #+end_src +** Sending Mail +