From 7d8c45c278373f2c5a717151fad73a5165fe9a03 Mon Sep 17 00:00:00 2001 From: Dennis Date: Sat, 6 Sep 2025 21:22:33 +0200 Subject: [PATCH] moves from emacs-patch overlay to home manager emacs --- home/darwin.nix | 5 +++++ modules/emacs/default.nix | 41 ++++++++++++++++++++++++++++++++++++++ overlays/emacs-patches.nix | 26 ------------------------ 3 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 modules/emacs/default.nix delete mode 100644 overlays/emacs-patches.nix diff --git a/home/darwin.nix b/home/darwin.nix index 2b9f030..da7d70a 100644 --- a/home/darwin.nix +++ b/home/darwin.nix @@ -10,6 +10,10 @@ GOPATH = "$HOME/go"; }; + home.packages = with pkgs; [ + # (aspellWithDicts (dicts: with dicts; [en en-computers en-science])) + ]; + xdg.enable = true; imports = [ @@ -20,6 +24,7 @@ ../modules/wezterm ../modules/nvim ../modules/lazygit + ../modules/emacs ]; programs.home-manager.enable = true; diff --git a/modules/emacs/default.nix b/modules/emacs/default.nix new file mode 100644 index 0000000..f17e4eb --- /dev/null +++ b/modules/emacs/default.nix @@ -0,0 +1,41 @@ +{ pkgs, ... }: + +{ + programs.emacs = { + enable = true; + + extraPackages = epkgs: [ epkgs.vterm ]; + + package = pkgs.emacs-pgtk.overrideAttrs ( + final: prev: { + # `emacs-28` patches are compatible with `emacs-29`. + # + # Where a compatible path exists, there is a symlink upstream to keep + # things clean, but GitHub doesn't follow symlinks to generate the + # responses we need (instead GitHub returns the target of the symlink). + patches = (prev.patches or [ ]) ++ [ + # Fix OS window role (needed for window managers like yabai) + (pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/fix-window-role.patch"; + sha256 = "0c41rgpi19vr9ai740g09lka3nkjk48ppqyqdnncjrkfgvm2710z"; + }) + # Use poll instead of select to get file descriptors + (pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/poll.patch"; + sha256 = "0j26n6yma4n5wh4klikza6bjnzrmz6zihgcsdx36pn3vbfnaqbh5"; + }) + # Enable rounded window with no decoration + (pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/round-undecorated-frame.patch"; + sha256 = "0x187xvjakm2730d1wcqbz2sny07238mabh5d97fah4qal7zhlbl"; + }) + # Make Emacs aware of OS-level light/dark mode + (pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/system-appearance.patch"; + sha256 = "14ndp2fqqc95s70fwhpxq58y8qqj4gzvvffp77snm2xk76c1bvnn"; + }) + ]; + } + ); + }; +} diff --git a/overlays/emacs-patches.nix b/overlays/emacs-patches.nix deleted file mode 100644 index 76e3f42..0000000 --- a/overlays/emacs-patches.nix +++ /dev/null @@ -1,26 +0,0 @@ -final: prev: { - emacs-patched = prev.emacsPgtk.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ - # Fix OS window role (needed for window managers like yabai) - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/fix-window-role.patch"; - sha256 = "0c41rgpi19vr9ai740g09lka3nkjk48ppqyqdnncjrkfgvm2710z"; - }) - # Use poll instead of select to get file descriptors - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/poll.patch"; - sha256 = "0j26n6yma4n5wh4klikza6bjnzrmz6zihgcsdx36pn3vbfnaqbh5"; - }) - # Enable rounded window with no decoration - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/round-undecorated-frame.patch"; - sha256 = "111i0r3ahs0f52z15aaa3chlq7ardqnzpwp8r57kfsmnmg6c2nhf"; - }) - # Make Emacs aware of OS-level light/dark mode - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/system-appearance.patch"; - sha256 = "14ndp2fqqc95s70fwhpxq58y8qqj4gzvvffp77snm2xk76c1bvnn"; - }) - ]; - }); -}