From e675b3d34cbe5347280b28cb449dbb5c1d110dff Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Oct 2023 11:59:13 +0000 Subject: modules/emacs: build init with packages available Otherwise it complains about not being able to find them. --- modules/workstation/emacs/default.nix | 123 +++++++++++++++++----------------- modules/workstation/emacs/init.el | 9 ++- 2 files changed, 68 insertions(+), 64 deletions(-) diff --git a/modules/workstation/emacs/default.nix b/modules/workstation/emacs/default.nix index ed4c4e4f8254..ce1b09a31bb9 100644 --- a/modules/workstation/emacs/default.nix +++ b/modules/workstation/emacs/default.nix @@ -1,70 +1,71 @@ { config, pkgs, ... }: +let + emacs = ((with pkgs; emacsPackagesFor emacs29-pgtk).emacsWithPackages (epkgs: with epkgs; [ + adoc-mode + cmake-mode + code-review + csharp-mode + d-mode + direnv + dockerfile-mode + ebuild-mode + editorconfig + eglot + elpher + execline + forge + gn-mode + gnuplot-mode + go-mode + graphql-mode + graphviz-dot-mode + groovy-mode + haskell-mode + jam-mode + just-mode + kotlin-mode + lua-mode + magit + markdown-mode + meson-mode + monokai-theme + mutt-mode + ninja-mode + nix-mode + notmuch + org-roam + pass + pod-mode + protobuf-mode + rainbow-delimiters + rust-mode + sdlang-mode + sort-words + toml-mode + tuareg + typescript-mode + udev-mode + vala-mode + yaml-mode + zig-mode + ])); +in + { - environment.systemPackages = [ - ((with pkgs; emacsPackagesFor emacs29-pgtk).emacsWithPackages (epkgs: with epkgs; [ - adoc-mode - cmake-mode - code-review - csharp-mode - d-mode - direnv - dockerfile-mode - ebuild-mode - editorconfig - eglot - elpher - execline - forge - gn-mode - gnuplot-mode - go-mode - graphql-mode - graphviz-dot-mode - groovy-mode - haskell-mode - jam-mode - just-mode - kotlin-mode - lua-mode - magit - markdown-mode - meson-mode - monokai-theme - mutt-mode - ninja-mode - nix-mode - notmuch - org-roam - pass - pod-mode - protobuf-mode - rainbow-delimiters - rust-mode - sdlang-mode - sort-words - toml-mode - tuareg - typescript-mode - udev-mode - vala-mode - yaml-mode - zig-mode - ])) - ]; + environment.systemPackages = [ emacs ]; systemd.tmpfiles.rules = [ "d ${config.users.users.qyliss.home}/notes 0700 qyliss qyliss" ]; - users.users.qyliss.xdg.config.paths."emacs" = with pkgs; - runCommand ".emacs.d" { - nativeBuildInputs = [ emacs29-pgtk ]; - } '' - cp ${./early-init.el} early-init.el - cp ${./init.el} init.el - emacs -L . --batch -f batch-byte-compile *.el - install -d $out - install *.el *.elc $out - ''; + users.users.qyliss.xdg.config.paths."emacs" = pkgs.runCommand ".emacs.d" { + nativeBuildInputs = [ emacs ]; + } '' + cp ${./early-init.el} early-init.el + cp ${./init.el} init.el + emacs -L . --batch -f batch-byte-compile *.el + install -d $out + install *.el *.elc $out + ''; } diff --git a/modules/workstation/emacs/init.el b/modules/workstation/emacs/init.el index f34cbc35981d..752362bf59ee 100644 --- a/modules/workstation/emacs/init.el +++ b/modules/workstation/emacs/init.el @@ -186,9 +186,6 @@ point." (transient-append-suffix command ["-S"] '("=S" "Don't sign using gpg" "--no-gpg-sign")))) -;;; mail ;;; -(setq mail-user-agent 'notmuch-user-agent) - ;;; Markdown ;;; (setq-default markdown-hide-markup t) @@ -223,6 +220,12 @@ point." (:name "lists" :query "-tag:done to:afra@afra-berlin.de OR to:@list.skarnet.org OR wayland-devel@lists.freedesktop.org OR to:distributions@lists.linux.dev" :key "l"))) (setq notmuch-tagging-keys '(("d" ("+done") "done"))) +;;; mail ;;; +; This has to go after we set the notmuch settings, for some reason, +; or they are not applied. +(require 'notmuch-mua) +(setq mail-user-agent 'notmuch-user-agent) + ;;; Org-mode ;;; (setq org-id-locations-file (concat user-emacs-directory "/org-id-locations")) -- cgit 1.4.1