Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created February 27, 2017 14:39
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grahamc/2daa060dce38ad18ddfa7927e1b1a1b3 to your computer and use it in GitHub Desktop.
Save grahamc/2daa060dce38ad18ddfa7927e1b1a1b3 to your computer and use it in GitHub Desktop.
Package your user's emacs init.el etc. in to your nix emacs itself
{ pkgs ? import <nixpkgs> {} }:
let
emacsPackaging = pkgs.emacsPackagesNg;
my-mode = emacsPackaging.trivialBuild {
pname = "my-mode";
version = "1970-01-01";
src = pkgs.writeText "default.el" ''
(global-set-key (kbd "<end>") 'end-of-line)
(global-set-key (kbd "<home>") 'beginning-of-line)
(defun loader-after-plugins ()
(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
(global-fci-mode 1)
(editorconfig-mode 1)
(require 'notmuch)
(global-set-key (kbd "C-c m") `notmuch)
)
(add-hook 'after-init-hook #'global-flycheck-mode)
(add-hook 'after-init-hook #'loader-after-plugins)
'';
};
in
(emacsPackaging.emacsWithPackages (epkgs: with epkgs.melpaPackages; [
nix-mode
] ++ [
pkgs.notmuch
my-mode
]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment