about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-06-16T14·37+0200
committerVincent Ambo <mail@tazj.in>2018-06-16T14·37+0200
commit2e2e8379e93ecfae045e9746fd8f0b839133cb15 (patch)
tree8a06ed38d915ef23e6896969a57103edd6e0fe2e
parent8cc7d8da79b99531696802462474fe400eb04386 (diff)
fix(emacs): Fix ivy & prescient integration by manually pinning ivy
In the previous configuration the dependency on `ivy-pass` added a
second version of ivy to the load-path.

It is fixed by manually pinning ivy and its related packages and using
those to build ivy-pass.

This configuration should be temporary until the next time the MELPA
package set is updated in nixpkgs.

This caused the symptoms in raxod502/prescient.el#10
-rw-r--r--emacs.nix50
-rw-r--r--packages.nix1
2 files changed, 44 insertions, 7 deletions
diff --git a/emacs.nix b/emacs.nix
index 3f391fc1d709..96af4a9f29f8 100644
--- a/emacs.nix
+++ b/emacs.nix
@@ -39,6 +39,46 @@ eglot = emacsPackagesNg.melpaBuild rec {
   };
 };
 
+# ivy has not been updated in unstable for a while:
+ivySource = fetchFromGitHub {
+  owner  = "abo-abo";
+  repo   = "swiper";
+  rev    = "6f2939485d33e9b28022d3b6912a50669dcdd596";
+  sha256 = "1f2i6hkcbiqdw7fr9vabsm32a0gy647llzki6b97yv8vwa0klh2q";
+};
+
+withIvySources = pname: recipe: emacsPackagesNg.melpaBuild {
+  inherit pname;
+  version = "20180616";
+  recipeFile = builtins.toFile "${pname}-recipe" recipe;
+  src = ivySource;
+};
+
+newIvy.ivy = withIvySources "ivy" ''
+(ivy :files (:defaults
+             (:exclude "swiper.el" "counsel.el" "ivy-hydra.el")
+             "doc/ivy-help.org"))
+'';
+
+newIvy.counsel = withIvySources "counsel" ''
+(counsel :files ("counsel.el"))
+'';
+
+newIvy.swiper = withIvySources "swiper" ''
+(swiper :files ("swiper.el"))
+'';
+
+newIvy.ivy-pass = melpaBuild {
+  pname = "ivy-pass";
+  version = "20170812";
+  src = fetchFromGitHub {
+    owner  = "ecraven";
+    repo   = "ivy-pass";
+    rev    = "5b523de1151f2109fdd6a8114d0af12eef83d3c5";
+    sha256 = "18crb4zh2pjf0cmv3b913m9vfng27girjwfqc3mk7vqd1r5a49yk";
+  };
+};
+
 # prescient & ivy-prescient provide better filtering in ivy/counsel,
 # but they are not in nixpkgs yet:
 prescientSource = fetchFromGitHub {
@@ -62,7 +102,7 @@ ivy-prescient = emacsPackagesNg.melpaBuild {
   pname   = "ivy-prescient";
   version = "1.0";
   src     = prescientSource;
-  packageRequires = [ prescient ivy ];
+  packageRequires = [ prescient newIvy.ivy ];
 
   recipeFile = writeText "ivy-prescient-recipe" ''
     (ivy-prescient :files ("ivy-prescient.el"))
@@ -86,8 +126,6 @@ in emacsWithPackages(epkgs:
   (with epkgs.melpaPackages; [
     browse-kill-ring
     cargo
-    counsel
-    counsel-tramp
     dash
     dash-functional
     dockerfile-mode
@@ -99,8 +137,6 @@ in emacsWithPackages(epkgs:
     haskell-mode
     ht
     idle-highlight-mode
-    ivy
-    ivy-pass
     jq-mode
     kotlin-mode
     magit
@@ -118,7 +154,6 @@ in emacsWithPackages(epkgs:
     s
     smartparens
     string-edit
-    swiper
     telephone-line
     terraform-mode
     toml-mode
@@ -128,6 +163,9 @@ in emacsWithPackages(epkgs:
     yaml-mode
   ]) ++
 
+  # Use custom updated ivy packages
+  (lib.attrValues newIvy) ++
+
   # Custom packaged Emacs packages:
   [ nix-mode eglot prescient ivy-prescient pkgs.notmuch ]
 )
diff --git a/packages.nix b/packages.nix
index 2e0b01b9bcba..1ab5eef95709 100644
--- a/packages.nix
+++ b/packages.nix
@@ -42,7 +42,6 @@ in {
 
       kontemplate = unstable.kontemplate;
       mq-cli = unstable.mq-cli;
-      emacs = unstable.emacs; # emacs 26.1
       vlc = unstable.vlc; # VLC 3.0!
     };
   };