summary refs log tree commit diff
path: root/pkgs/top-level/emacs-packages.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2014-01-20 23:57:04 +0000
committerJan Malakhovski <oxij@oxij.org>2015-03-03 16:02:15 +0000
commite4a4e109ba49f3868f63a61e514c4846a1cd0b9a (patch)
tree66eea07b9a477857ed69dbd44bd153dbd78d1007 /pkgs/top-level/emacs-packages.nix
parenta444eff3f29c292ffb62700572cbd4c9cdb3718b (diff)
downloadnixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.tar
nixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.tar.gz
nixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.tar.bz2
nixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.tar.lz
nixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.tar.xz
nixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.tar.zst
nixpkgs-e4a4e109ba49f3868f63a61e514c4846a1cd0b9a.zip
refactor Emacs packages'/modes' builders
This simplifies melpa builder by merging with it my old emacs modes builder,
adds better instructions and support for overrides in emacs-packages.nix,
and renames some emacs-related stuff in all-packages.nix for sanity reasons.

I declare this backwards compatible since direct uses of emacsPackages in
configuration.nix are very unlikely.
Diffstat (limited to 'pkgs/top-level/emacs-packages.nix')
-rw-r--r--pkgs/top-level/emacs-packages.nix53
1 files changed, 32 insertions, 21 deletions
diff --git a/pkgs/top-level/emacs-packages.nix b/pkgs/top-level/emacs-packages.nix
index 0be7a3adf47..9f7c9675cb0 100644
--- a/pkgs/top-level/emacs-packages.nix
+++ b/pkgs/top-level/emacs-packages.nix
@@ -1,27 +1,37 @@
-{ pkgs, stdenv, fetchurl, fetchFromGitHub, fetchgit
-, emacs, texinfo
-
-# non-emacs packages
-, external
-}:
-
 # package.el-based emacs packages
-
-## init.el
+#
+## add this at the start your init.el:
 # (require 'package)
-# (setq package-archives nil
-#       package-user-dir "~/.nix-profile/share/emacs/site-lisp/elpa")
+#
+# ;; optional. makes unpure packages archives unavailable
+# (setq package-archives nil)
+#
+# (add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
+#
+# ;; optional. use this if you install emacs packages to user profiles (with nix-env)
+# (add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
+#
 # (package-initialize)
 
-with stdenv.lib.licences;
+{ overrides
 
-let
-  melpaBuild = import ../build-support/emacs/melpa.nix {
-    inherit stdenv fetchurl emacs texinfo;
-  };
-in
+, lib, stdenv, fetchurl, fetchgit, fetchFromGitHub
+
+, emacs
+, trivialBuild
+, melpaBuild
+
+, external
+}@args:
+
+with lib.licences;
+
+let self = _self // overrides;
+    callPackage = lib.callPackageWith (self // removeAttrs args ["overrides" "external"]);
+    _self = with self; {
+
+  ## START HERE
 
-rec {
   ac-haskell-process = melpaBuild rec {
     pname   = "ac-haskell-process";
     version = "0.5";
@@ -100,7 +110,7 @@ rec {
       description = "Auto-complete extension for Emacs";
       homepage = http://cx4a.org/software/auto-complete/;
       license = gpl3Plus;
-      platforms = stdenv.lib.platforms.all;
+      platforms = lib.platforms.all;
     };
   };
 
@@ -709,7 +719,7 @@ rec {
       rev    = "4cb2ced1eda5167ce774e04657d2cd077b63c706";
       sha256 = "003sihp7irm0qqba778dx0gf8xhkxd1xk7ig5kgkryvl2jyirk28";
     };
-    postPatch = stdenv.lib.optionalString (!stdenv.isLinux) ''
+    postPatch = lib.optionalString (!stdenv.isLinux) ''
       rm weechat-sauron.el weechat-secrets.el
     '';
     packageRequires = [ s ];
@@ -727,4 +737,5 @@ rec {
     };
     meta = { licence = gpl3Plus; };
   };
-}
+
+}; in self