aboutsummaryrefslogtreecommitdiff
path: root/macos.local/.flake/home/programs/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'macos.local/.flake/home/programs/emacs')
-rw-r--r--macos.local/.flake/home/programs/emacs/core.nix.org87
1 files changed, 53 insertions, 34 deletions
diff --git a/macos.local/.flake/home/programs/emacs/core.nix.org b/macos.local/.flake/home/programs/emacs/core.nix.org
index 599dd54..4630b0f 100644
--- a/macos.local/.flake/home/programs/emacs/core.nix.org
+++ b/macos.local/.flake/home/programs/emacs/core.nix.org
@@ -1,5 +1,6 @@
#+title: Emacs Configuration
+Here is my Emacs configuration. Define configuration files that should exist.
#+begin_src nix
{ config, pkgs, ... }:
@@ -12,43 +13,61 @@
"./.config/emacs/user-interface.el".source = ./user-interface.el;
"./.config/emacs/tools.el".source = ./tools.el;
"./.config/emacs/languages.el".source = ./languages.el;
- "./Applications/Emacs.app/Contents/MacOS/Emacs" = {
- executable = true;
- text = ''
- #!/bin/sh
- emacsclient -c & disown
- '';
- };
+#+end_src
+
+Define a macOS application wrapper for =emacsclient=.
+#+begin_src nix
+ "./Applications/Emacs.app/Contents/MacOS/Emacs" = {
+ executable = true;
+ text = ''
+#+end_src
+
+Run =emacsclient= and disown the process before closing.
+#+begin_src sh
+ #!/bin/sh
+ emacsclient -c & disown
+#+end_src
+
+Close the block.
+#+begin_src nix
+ '';
};
+ };
+#+end_src
- nixpkgs.overlays = [
- (final: prev:
- {
- emacs29-pgtk = prev.emacs29-pgtk.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 = "sha256-+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE=";
- })
- # 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 = "sha256-uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4=";
- })
- # 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 = "sha256-oM6fXdXCWVcBnNrzXmF0ZMdp8j0pzkLE66WteeCutv8=";
- })
- ];
- });
- }
- )
- ];
+Apply patches from =d12frosted/emacs-plus= Homebrew package for Emacs:
+- Fix OS window role (=yabai= needs this to tile Emacs)
+- Enable rounded window with no decoration (I don't really use this)
+- Make Emacs aware of OS-level light/dark mode
+#+begin_src nix
+ nixpkgs.overlays = [
+ (final: prev:
+ {
+ emacs29-pgtk = prev.emacs29-pgtk.overrideAttrs (old: {
+ patches =
+ (old.patches or [])
+ ++ [
+ (prev.fetchpatch {
+ url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/fix-window-role.patch";
+ sha256 = "sha256-+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE=";
+ })
+ (prev.fetchpatch {
+ url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/round-undecorated-frame.patch";
+ sha256 = "sha256-uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4=";
+ })
+ (prev.fetchpatch {
+ url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/system-appearance.patch";
+ sha256 = "sha256-oM6fXdXCWVcBnNrzXmF0ZMdp8j0pzkLE66WteeCutv8=";
+ })
+ ];
+ });
+ }
+ )
+ ];
+#+end_src
+Install Emacs program and service.
+#+begin_src nix
programs.emacs = {
enable = true;
package = pkgs.emacs29-pgtk;