summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-06-06 11:40:44 +0200
committerAlan Pearce2017-06-06 11:40:49 +0200
commitae050e529e4b08bcf025e1c4e77a3da5a6c0ef80 (patch)
tree5f9e99eb880ebcd684f4eca368877c91f5fa4727
parent9d5b7f2a1412167e390a6e4f4c3c9401840ae147 (diff)
downloadnixfiles-ae050e529e4b08bcf025e1c4e77a3da5a6c0ef80.tar.lz
nixfiles-ae050e529e4b08bcf025e1c4e77a3da5a6c0ef80.tar.zst
nixfiles-ae050e529e4b08bcf025e1c4e77a3da5a6c0ef80.zip
nix: Add Emacs build with packages
Install with `nix-env -iA nixpkgs.myEmacs` (depending on nix namespace)
-rw-r--r--nix/.config/nixpkgs/config.nix9
-rw-r--r--nix/.config/nixpkgs/emacs.nix156
2 files changed, 165 insertions, 0 deletions
diff --git a/nix/.config/nixpkgs/config.nix b/nix/.config/nixpkgs/config.nix
new file mode 100644
index 00000000..3b506937
--- /dev/null
+++ b/nix/.config/nixpkgs/config.nix
@@ -0,0 +1,9 @@
+{ pkgs }: {
+  packageOverrides = super: let
+    self = super.pkgs;
+  in with self; rec {
+    myEmacs = super.callPackage ./emacs.nix {};
+  };
+
+  allowUnfree = true;
+}
diff --git a/nix/.config/nixpkgs/emacs.nix b/nix/.config/nixpkgs/emacs.nix
new file mode 100644
index 00000000..84b1831f
--- /dev/null
+++ b/nix/.config/nixpkgs/emacs.nix
@@ -0,0 +1,156 @@
+{ pkgs ? import <nixpkgs> {}, stdenv }:
+
+let
+  myEmacs = if stdenv.isDarwin then pkgs.emacs25Macport else pkgs.emacs;
+  emacsWithPackages = (pkgs.emacsPackagesNgGen myEmacs).emacsWithPackages;
+
+  elpaBuild = import <nixpkgs/pkgs/build-support/emacs/elpa.nix> {
+    inherit (pkgs) fetchurl lib stdenv texinfo;
+    emacs = myEmacs;
+  };
+
+  hook-helpers = pkgs.callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
+    pname = "hook-helpers";
+    version = "1.1";
+    src = fetchurl {
+      url = "http://elpa.gnu.org/packages/hook-helpers-1.1.tar";
+      sha256 = "0xvabl0lfc0ijr98clsyh0bqk2fdi1ncl0knn58j2p30gn9958i5";
+    };
+    packageRequires = [];
+    meta = {
+      homepage = https://savannah.nongnu.org/projects/hook-helpers-el/;
+      license = lib.licenses.free;
+    };
+  }) {
+    inherit elpaBuild;
+    inherit (pkgs) fetchurl lib;
+  };
+
+  dired-du = pkgs.callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
+    pname = "dired-du";
+    version = "0.5";
+    src = fetchurl {
+      url = "http://elpa.gnu.org/packages/dired-du-0.5.tar";
+      sha256 = "09yj37p2fa5f81fqrzwghjkyy2ydsf4rbkfwpn2yyvzd5nd97bpl";
+    };
+    packageRequires = [];
+    meta = {
+      homepage = https://github.com/calancha/dired-du;
+      license = lib.licenses.free;
+    };
+  }) {
+    inherit elpaBuild;
+    inherit (pkgs) fetchurl lib;
+  };
+in
+  emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
+    diminish
+    bind-key
+    use-package
+  ]) ++ (with epkgs.melpaPackages; [
+    ace-link
+    ace-window
+    add-node-modules-path
+    ag
+    async
+    auto-compile
+    avy
+    bbdb
+    beginend
+    cider
+    clj-refactor
+    clojure-mode
+    cmd-to-echo
+    coffee-mode
+    command-log-mode
+    company
+    company-go
+    company-nixos-options
+    company-restclient
+    company-tern
+    company-web
+    counsel
+    counsel-projectile
+    crux
+    cyphejor
+    dired-du
+    dired-narrow
+    dired-plus
+    dired-subtree
+    discover-my-major
+    dockerfile-mode
+    dtrt-indent
+    dumb-jump
+    easy-hugo
+    editorconfig
+    elisp-slime-nav
+    emmet-mode
+    ensime
+    exec-path-from-shell
+    expand-region
+    eyebrowse
+    eziam-theme
+    flow-minor-mode
+    flycheck
+    flycheck-flow
+    flycheck-pos-tip
+    flycheck-vale
+    geiser
+    ggtags
+    ghq
+    git-gutter-fringe
+    git-messenger
+    git-timemachine
+    go-eldoc
+    go-mode
+    go-projectile
+    goto-chg
+    haskell-mode
+    highlight-stages
+    imenu-anywhere
+    indium
+    jinja2-mode
+    js2-mode
+    js2-refactor
+    json-mode
+    ledger-mode
+    lua-mode
+    magit
+    markdown-mode
+    move-text
+    multiple-cursors
+    nginx-mode
+    nix-mode
+    org-journal
+    page-break-lines
+    paredit
+    password-store
+    projectile
+    projectile-ripgrep
+    quickrun
+    redshank
+    relative-buffers
+    restclient
+    ripgrep
+    scala-mode
+    scss-mode
+    shrink-whitespace
+    slime
+    smart-tabs-mode
+    smartparens
+    smex
+    swiper
+    tern
+    undo-tree
+    visual-regexp
+    volatile-highlights
+    web-mode
+    wgrep-ag
+    which-key
+    yaml-mode
+  ]) ++ (with epkgs.elpaPackages; [
+    beacon
+  ]) ++ [
+    hook-helpers                #  defined above
+    # From main packages set
+  ])