From c2467e5a6400f9967ff7f805f89e7d9032c204e9 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Mon, 12 May 2025 09:56:20 +0200 Subject: [PATCH] feat: Add emacs from emacs-branch via inferiors --- channels-emacs-lock.scm | 11 +++++++++++ home/home-configuration.scm | 11 +++++++---- home/modules/ruther/home/dwl/wm.scm | 8 ++++---- home/modules/ruther/home/emacs.scm | 26 ++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 channels-emacs-lock.scm create mode 100644 home/modules/ruther/home/emacs.scm diff --git a/channels-emacs-lock.scm b/channels-emacs-lock.scm new file mode 100644 index 0000000..8bbc076 --- /dev/null +++ b/channels-emacs-lock.scm @@ -0,0 +1,11 @@ +(list (channel + (name 'guix) + (url "https://codeberg.org/guix/guix-mirror") + (branch "emacs-team") + (commit + "55b894145ef13c6357bf79bd80de63cd366bcd26") + (introduction + (make-channel-introduction + "9edb3f66fd807b096b48283debdcddccfea34bad" + (openpgp-fingerprint + "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))) diff --git a/home/home-configuration.scm b/home/home-configuration.scm index b33aeba..2fb7689 100644 --- a/home/home-configuration.scm +++ b/home/home-configuration.scm @@ -36,6 +36,7 @@ (gnu home services xdg) (gnu home services syncthing) (gnu home services) + (ruther home emacs) (ruther home dwl wm) (ruther home dwl scripts) (ruther home packages themes) @@ -103,13 +104,15 @@ ;; Home profile, under ~/.guix-home/profile. (packages (append - (list + (cons* dwl-mine font-awesome-6 offlineimap (apply-patches msmtp - (local-file "./patches/msmtp-from-utf8-encoding.patch"))) + (local-file "./patches/msmtp-from-utf8-encoding.patch")) + (emacs-for-tty) + (emacs-packages)) (specifications->packages (list "man-db" @@ -164,7 +167,7 @@ "xdg-utils" "libnotify" ;; Editing - "emacs" "emacs-vterm" + ;; emacs and emacs-vterm from inferiors "tree-sitter-vhdl" "tree-sitter-rust" "tree-sitter-bash" "tree-sitter-awk" "tree-sitter-nix" "tree-sitter-python" "tree-sitter-c" "tree-sitter-cpp" "tree-sitter-c-sharp" @@ -340,7 +343,7 @@ exec ~a ~a" (waybar waybar-mine))) (service home-emacs-service-type (home-emacs-configuration - (emacs emacs-pgtk))) + (emacs (emacs-for-wayland)))) (service hydroxide-service-type) (service mpris-ctld-service-type) (service home-blueman-applet-service-type) diff --git a/home/modules/ruther/home/dwl/wm.scm b/home/modules/ruther/home/dwl/wm.scm index 424778f..759f9d0 100644 --- a/home/modules/ruther/home/dwl/wm.scm +++ b/home/modules/ruther/home/dwl/wm.scm @@ -13,6 +13,7 @@ #:use-module (ruther packages wayland) #:use-module (ruther home passwords) + #:use-module (ruther home emacs) #:use-module (guix build-system trivial) @@ -135,7 +136,7 @@ (("\"passmenu\"") (string-append "\"" #$password-store-wl "/bin/passmenu\"")) (("\"passmenu-totp\"") (string-append "\"" #$password-store-passmenus "/bin/passmenu-totp\"")) (("\"passmenu-multi\"") (string-append "\"" #$password-store-passmenus "/bin/passmenu-multi\"")) - (("\"emacsclient\"") (string-append "\"" #$emacs-pgtk "/bin/emacsclient\"")) + (("\"emacsclient\"") (string-append "\"" #$(emacs-for-wayland) "/bin/emacsclient\"")) (("%brightness%") #$brightness-script) (("%printscreen%") #$printscreen-script))))))))))) @@ -163,6 +164,7 @@ (list (packages->manifest (list + (emacs-for-wayland) xdg-data-dirs-package)) (specifications->manifest '("brillo" @@ -175,9 +177,7 @@ "mpris-ctl" "password-store-wl" - "pass-otp" - - "emacs-pgtk"))))) + "pass-otp"))))) (define dwl-mine-gexp (with-imported-modules '((guix build utils) diff --git a/home/modules/ruther/home/emacs.scm b/home/modules/ruther/home/emacs.scm new file mode 100644 index 0000000..b2c1b87 --- /dev/null +++ b/home/modules/ruther/home/emacs.scm @@ -0,0 +1,26 @@ +(define-module (ruther home emacs) + #:use-module (srfi srfi-1) + #:use-module (guix memoization) + #:use-module (guix inferior) + #:use-module (guix ui) + #:export (emacs-for-tty + emacs-for-wayland + emacs-packages)) + +(define emacs-channels + (load* "./channels-emacs-lock.scm" (make-user-module '((guix channels))))) + +(define emacs-inferior + (inferior-for-channels emacs-channels)) + +(define emacs-for-tty + (mlambda () + (first (lookup-inferior-packages emacs-inferior "emacs")))) +(define emacs-packages + (mlambda () + (list + (first (lookup-inferior-packages emacs-inferior "emacs-vterm"))))) + +(define emacs-for-wayland + (mlambda () + (first (lookup-inferior-packages emacs-inferior "emacs-pgtk")))) -- 2.49.0