about summary refs log tree commit diff
path: root/home/profiles
diff options
context:
space:
mode:
Diffstat (limited to 'home/profiles')
-rw-r--r--home/profiles/development/default.nix28
1 files changed, 25 insertions, 3 deletions
diff --git a/home/profiles/development/default.nix b/home/profiles/development/default.nix
index c47040e..846a593 100644
--- a/home/profiles/development/default.nix
+++ b/home/profiles/development/default.nix
@@ -186,12 +186,34 @@ in
       client.enable = true;
       socketActivation.enable = true;
     };
-    programs.emacs.enable = true;
-    programs.zshell.aliases = {
-      e = "emacsclient -ta emacs";
+    programs.emacs = {
+      enable = true;
+      package = pkgs.emacs29-pgtk;
     };
 
+    home.activation.installFootEmacsTerminfo = ''
+      ${pkgs.ncurses}/bin/tic -x -o $HOME/.terminfo ${
+        pkgs.fetchurl {
+          url =
+            "https://gist.githubusercontent.com/sefidel/5f7f46783ad527ada98caa13e32efd42/raw/509375cc7bff269bb3b906fd417ed3d51b4a1cc5/foot-emacs.src";
+          sha256 = "sha256-aR/C40NWbrwYRIAvaRL/6gUAcP7xokChOVJIbyDXAwI=";
+        }
+      }
+    '';
+
     home.packages = [
+      # Launchable graphical emacsclient in bemenu
+      (pkgs.writeShellScriptBin "ec" "emacsclient -cna emacs $@")
+      # Emacsclient with 24bit colours fix for foot
+      (pkgs.writeShellScriptBin "e" ''
+       if [[ "$TERM" == "foot" ]]; then
+          eprefix="TERM=foot-emacs"
+        elif [[ "$TERM" == "foot-direct" ]]; then
+          eprefix="TERM=foot-direct-emacs"
+        fi
+        eval "$eprefix emacsclient -ta emacs $@"
+      '')
+
       pkgs.bfg-repo-cleaner
       pkgs.diffoscopeMinimal
       pkgs.colmena