about summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs-modes
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2019-08-03 20:42:26 +0100
committeradisbladis <adisbladis@gmail.com>2019-08-07 18:04:19 +0100
commit891122697121ac52a250bcfca891fd2bd4b19c70 (patch)
tree0580f79c92a81de63b35d8034d04153538221d85 /pkgs/applications/editors/emacs-modes
parent9c0f22a45b5551b8fe9fabfa7667560dd956e345 (diff)
emacs-packages: Allow update script to be called from any location
Previously working directory was important
Diffstat (limited to 'pkgs/applications/editors/emacs-modes')
-rwxr-xr-xpkgs/applications/editors/emacs-modes/update-melpa8
-rw-r--r--pkgs/applications/editors/emacs-modes/updater-emacs.nix65
2 files changed, 41 insertions, 32 deletions
diff --git a/pkgs/applications/editors/emacs-modes/update-melpa b/pkgs/applications/editors/emacs-modes/update-melpa
index 2b2af5cb2bbef..5c636416a5e6b 100755
--- a/pkgs/applications/editors/emacs-modes/update-melpa
+++ b/pkgs/applications/editors/emacs-modes/update-melpa
@@ -1,8 +1,6 @@
 #! /usr/bin/env nix-shell
-#! nix-shell --show-trace -i sh -p git nix nix-prefetch-git nix-prefetch-hg "import ./updater-emacs.nix"
+#! nix-shell --show-trace ./updater-emacs.nix -i bash
 
-# "with import ../../../.. {}; emacsWithPackages (epkgs: with epkgs.melpaPackages; [ promise semaphore ])"
+SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
 
-exec emacs --fg-daemon=updater --quick -l update-melpa.el -f run-updater "$@"
-
-# exec emacs update-melpa.el "$@"
+exec emacs --fg-daemon=updater --quick -l $SCRIPT_DIR/update-melpa.el -f run-updater "$@"
diff --git a/pkgs/applications/editors/emacs-modes/updater-emacs.nix b/pkgs/applications/editors/emacs-modes/updater-emacs.nix
index b64a410e7b40c..c7e858078e6bf 100644
--- a/pkgs/applications/editors/emacs-modes/updater-emacs.nix
+++ b/pkgs/applications/editors/emacs-modes/updater-emacs.nix
@@ -1,29 +1,40 @@
-with import ../../../.. {};
-(emacsPackagesNgFor emacs26).
-emacsWithPackages (epkgs: let
-  promise = epkgs.trivialBuild {
-    pname = "promise";
-    version = "1";
-    src = fetchFromGitHub {
-      owner = "bendlas";
-      repo = "emacs-promise";
-      rev = "4da97087c5babbd8429b5ce62a8323b9b03c6022";
-      sha256 = "0yin7kj69g4zxs30pvk47cnfygxlaw7jc7chr3b36lz51yqczjsy";
-      
+let
+  pkgs = import ../../../.. {};
+
+  emacsEnv = (pkgs.emacsPackagesNgFor pkgs.emacs26).emacsWithPackages (epkgs: let
+
+    promise = epkgs.trivialBuild {
+      pname = "promise";
+      version = "1";
+      src = pkgs.fetchFromGitHub {
+        owner = "bendlas";
+        repo = "emacs-promise";
+        rev = "4da97087c5babbd8429b5ce62a8323b9b03c6022";
+        sha256 = "0yin7kj69g4zxs30pvk47cnfygxlaw7jc7chr3b36lz51yqczjsy";
+      };
     };
-  };
-  semaphore = epkgs.trivialBuild {
-    pname = "semaphore";
-    version = "1";
-    packageRequires = [ promise ];
-    src = fetchFromGitHub {
-      owner = "webnf";
-      repo = "semaphore.el";
-      rev = "93802cb093073bc6a6ccd797328dafffcef248e0";
-      sha256 = "09pfyp27m35sv340xarhld7xx2vv5fs5xj4418709iw6l6hpk853";
-      
+
+    semaphore = epkgs.trivialBuild {
+      pname = "semaphore";
+      version = "1";
+      packageRequires = [ promise ];
+      src = pkgs.fetchFromGitHub {
+        owner = "webnf";
+        repo = "semaphore.el";
+        rev = "93802cb093073bc6a6ccd797328dafffcef248e0";
+        sha256 = "09pfyp27m35sv340xarhld7xx2vv5fs5xj4418709iw6l6hpk853";
+      };
     };
-  };
-  in [ promise semaphore ]
-     #  ++ (with epkgs.melpaPackages; [ smex rainbow-delimiters paredit ])
-)
+
+  in [ promise semaphore ]);
+
+in pkgs.mkShell {
+  buildInputs = [
+    pkgs.git
+    pkgs.nix
+    pkgs.bash
+    pkgs.nix-prefetch-git
+    pkgs.nix-prefetch-hg
+    emacsEnv
+  ];
+}