Commit 8a921c18e47e

Vincent Demeester <vincent@sbr.pm>
2020-03-05 14:30:01
Use emacs27 (27.0.99 aka pretest1) 🥚
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent aff8066
modules/profiles/emacs.nix
@@ -47,7 +47,7 @@ in
       };
       programs.emacs = {
         enable = true;
-        package = pkgs.emacs.override { inherit (pkgs) imagemagick; withXwidgets = cfg.withXwidgets; };
+        package = pkgs.emacs27.override { inherit (pkgs) imagemagick; withXwidgets = cfg.withXwidgets; };
         extraPackages = epkgs: with epkgs; [
           ace-window
           aggressive-indent
overlays/patches/.gitkeep
overlays/patches/clean-env.patch
@@ -0,0 +1,16 @@
+Dump temacs in an empty environment to prevent -dev paths from ending
+up in the dumped image.
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index fd05a45df5..13f529c253 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -570,7 +570,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) \
+                 lisp.mk $(etc)/DOC $(lisp) \
+                 $(lispsource)/international/charprop.el ${charsets}
+ ifeq ($(DUMPING),unexec)
+-	LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
++	env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
+   ifneq ($(PAXCTL_dumped),)
+ 	      $(PAXCTL_dumped) emacs$(EXEEXT)
+   endif
overlays/patches/tramp-detect-wrapped-gvfsd.patch
@@ -0,0 +1,14 @@
+diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
+index 3ce7bbbd4a..e31059da3f 100644
+--- a/lisp/net/tramp-gvfs.el
++++ b/lisp/net/tramp-gvfs.el
+@@ -125,7 +125,8 @@
+ 	 (autoload 'zeroconf-init "zeroconf")
+ 	 (tramp-compat-funcall 'dbus-get-unique-name :system)
+ 	 (tramp-compat-funcall 'dbus-get-unique-name :session)
+-	 (or (tramp-process-running-p "gvfs-fuse-daemon")
++	 (or (tramp-process-running-p ".gvfsd-fuse-wrapped")
++             (tramp-process-running-p "gvfs-fuse-daemon")
+ 	     (tramp-process-running-p "gvfsd-fuse"))))
+   "Non-nil when GVFS is available.")
+ 
overlays/sbr.nix
@@ -9,4 +9,18 @@ self: super:
   vscodeliveshare = import ../pkgs/vscodeliveshare {
     inherit (self) stdenv vscode-utils autoPatchelfHook xorg gnome3 utillinux openssl icu zlib curl lttng-ust libsecret libkrb5 gcc libunwind binutils;
   };
+  emacs27 = (self.emacs.override { srcRepo = true; }).overrideAttrs(old: {
+    name = "emacs-dev";
+    version = "27.0.99";
+    src = super.fetchFromGitHub {
+      owner = "emacs-mirror";
+      repo = "emacs";
+      rev = "emacs-27.0.90";
+      sha256 = "13n82lxbhmkcmlzbh0nml8ydxyfvz8g7wsdq7nszlwmq914gb5nk";
+    };
+    buildInputs = old.buildInputs ++ [ super.jansson ];
+    patches = [
+      ./patches/clean-env.patch
+    ];
+  });
 }